Add an arcpy.mapping.AnalyzeForSD equivalent to arcpy.mp

546
4
01-09-2024 10:53 AM
Status: Open
Labels (1)
StephenRhea_NV5
Occasional Contributor

We have a customized publishing workflow to restrict what/how/where users publish, and part of that workflow includes analyzing the map for any errors. In ArcMap, we would call arcpy.mapping.AnalyzeForSD, report any errors, and stop processing if needed. However, in ArcGIS Pro, we have to call arcpy.StageService_server, then report any errors. I'm not sure if that call short-circuits if any errors exist, but it seems to take substantially longer to process than ArcMap did.

Having a direct call to AnalyzeForSD would both shorten the time when errors are encountered and allow easier diagnosis on crashes to know whether analysis or staging failed. This has been discussed on Community, and even had a bug submitted. While the bug has been marked as "will not be addressed", I would implore a reconsideration, especially since the workaround listed is no longer viable.

4 Comments
ShilpiJain

Hi, analyze is automatically called when Stage Service method is called. Errors are thrown as exception and we can use arcpy.GetMessages() for warnings.

Documentation: https://pro.arcgis.com/en/pro-app/latest/tool-reference/server/stage-service.htm 

Sample of analyzer error: https://pro.arcgis.com/en/pro-app/latest/arcpy/sharing/featuresharingdraft-class.htm#GUID-608E5D98-B...

Sample of analyzer warning: https://pro.arcgis.com/en/pro-app/latest/arcpy/sharing/mapimagesharingdraft-class.htm#GUID-8C8AAD18-... 

StephenRhea_NV5

Thanks for responding so quickly, @ShilpiJain! The samples were helpful because it showed that I had to set the checkUniqueIDAssignment flag, which was an impetus for creating this idea.

Having said that, I'd still appreciate an independent Analyze method because in our custom process, we create the SD file on a fileshare, which can be painfully slow. It's frustrating to have to wait that extra time simply to show any warnings to the user, and an independent Analyze method would shorten that process substantially.

FredSpataro

@ShilpiJain Analyze BEFORE StageService is really needed for copyDataToServer=False.   In my attempts, I've set this property to false, but the StageService copies all of my data to a local geodatabase before i could get the warning about the data source not being registered.  This is unacceptable workflow as it puts an extreme load on the db server that wasn't necessary if it had given us the 'not registered warning' before attempting to pull it across.  I've also run out of disk space, had file too big errors and other things associated with pulling too much data from a db server.  If you're not going to add an 'Analyze' function then StageService tool should immediately quit with errors when copyDataToServer=False.  Just like the UI does.  

RonnieRichards

Yes please make this consistent with the legacy arcpy mapping analyze as well as the current creategeocodesddraft. It does not make sense why this was changed and inconsistent with geocode drafts.

CreateGeocodeSDDraft—ArcGIS Pro | Documentation

RonnieRichards_0-1712599128432.png