I created a model using ArcMap 10.8 and save in toolbox.
It starts by creating a new FGDB with _TodaysDate variable in the name and saving to local drive.
Then generates a number of feature classes and saves into GDB.
Then using those intermediate outputs, appends data to SDE feature classes.
That is it.
The model does not have any delete functionality (except delete features on some SDE feature classes that are being appended to).
The model runs successfully in model builder edit mode, including the updates to SDE, and the creation of FGDB and all the intermediate Feature classes inside.
When I run the model from Python 2.7 it runs successfully and updates the SDE but the feature classes inside the FGDB get deleted before python finishes executing.
The FGDB does not get deleted.
The only thing the python does is is execute the model and then email me to tell me about it. No deleting is programmed.
What could be causing the feature classes to get deleted after the append which is the last step in the model?
Any Thoughts?
Edit to add relevant code from python:
#model update
m1 = "m1 not complete "
m2 = "m2 not complete "
try:
tbx = arcpy.AddToolbox(r"E:/toolboxpath/toolbox.tbx")
print tbx
print "model update started"
tbx.PRODNS()
m1 = "m1 Complete"
tbx.PRODSAO()
m2 = "m2 Complete"
print "model update complete"
send_email('not_my_real_email@fakeemail.fake',
'CENSUS DATA UPDATED',
'CENSUS DATA UPDATED BOTH MODELS',
'')
except arcpy.ExecuteError:
message = str(m1 + m2 + arcpy.GetMessages(2))
print(arcpy.GetMessages(2))
send_email('not_my_real_email@fakeemail.fake',
'FAILED CENSUS UPDATE FAILED',
message,
'')