I am writing a script to auto update attributes for several FCs in my enterprise SDE.
I am testing the script and there are no processing bugs however there is strange behavior. When the script completes both the default version and the child version have received the updates. There is no part of the script that reconciles or posts the version. Logically this should not be happening.
I have set the workspace to the specific version (not the default) by creating a new database connection with the version of interest defined as the the active version. As per this post.
I tried to use arcpy.ChangeVersions_management as an alternative but that only works in an active view inside ArcMap and does not work remotely. Error 00825.
My instinct is that there is some setting in the SDE that will prevent that I am not aware of. Is there any way to fix this?
I included the sections of code that I believe might be producing this behavior:
#Set workspace (as per above)
thefolder = os.path.dirname(sys.argv[0]) # folder path containing script
Environ = thefolder + "\\Connections\\DevVersion.sde"
arcpy.env.workspace = Environ
# Create a Feature Dataset to store processing outputs
arcpy.CreateFeatureDataset_management(out_dataset_path=arcpy.env.workspace, out_name="devsde.SYOKLIC1.SpatialJoin_Output", spatial_reference="PROJCS['NAD_1983_HARN...']")
##I then create lists and loops to disable editor tracking and preform a spatial join
# Update original features from spatial join layer records using SQL
sdeConn = arcpy.ArcSDESQLExecute(Environ)
query_list = ["Update...."]
for query in query_list:
sdeConn.execute(query)
##Then delete the Feature Dataset that was created and re-enable editor tracking