Select to view content in your preferred language

ChangeVersion in a BRANCH not working in toolbox

72
1
Friday
Labels (2)
MatheusSparapani
Occasional Contributor

I'm having trouble running the arcpy.management.ChangeVersion() tool in arcpy to change the branch version of a Utility Network layer. The tool only works if you use it directly from the geoprocessing tool via the ArcGIS Pro graphical interface. However, when run in an isolated Python script, or via ArcGIS's own Notebook, it returns an error and does not change the version to the definition, despite being the same command copied from Geoprocessing.

MatheusSparapani_3-1749832899750.png

MatheusSparapani_2-1749832724438.png

Another point is that there is no way to check the branch version via arcpy, only via the graphical interface. Not even arcpy.Describe() makes the branch version explicit.

MatheusSparapani_0-1749832630220.jpeg

 

0 Kudos
1 Reply
VinceAngelo
Esri Esteemed Contributor

Branch versioning isn't just another flavor of database versioning. It has a specific set of use cases, all of which go through a services architecture endpoint.  So, it's not a property of the connection so much as a property of the service. I wouldn't expect ArcPy to be real useful here; this seems more in the domain of the ArcGIS API for Python (which is more Portal-centric).

This Blog from 2019 might help clarify how what you're describing is the intended design of Branch Versioning.

- V

0 Kudos