ArcPro crashes every time I try to run the very trivial program below. I've tried it in the ArcPro python pane (both 2.4.2 and 2.4.3) and under Spyder IDE - and using many variations to the code below. It does throw an error (as expected) if I feed it a bogus table datasource. The table doesn't appear corrupt since I can open it from the catalog pane. Is anybody else using this API call?
import arcpy
arcpy.env.workspace = r'C:\Users\dmorri28\Documents\ArcGIS\Projects\MyProject\CC-SQL2k16-ERC-SDE.sde'
arcpy.mp.Table('FieldShareLevel')
I'm running this with arcpy that got installed with ArcPro (currently at 2.4.3 but also failed on 2.4.2) and Python 3.6.8 and Advanced license.
Solved! Go to Solution.
Thanks for the suggestion Dan. Yes, I had tried that but it got me to go back and look at the full name and did lead me to find the problem, which was my fault. I was specifying the "short name" ('FieldShareLevel) instead of the full name (ROW_Habitat.SDE.FieldShareLevel). It seems a bit severe to be crashing for such a mistake, but... once I fixed that it works as expected - at least when called from the Python pane in ArcPro. Thanks again for the help.
In Catalog -> History does it create a log for the run?
Nope - it crashes right away and leaves no trace as far as I can see. There is a .dmp file created but I'd rather not try to figure out how to view and interpret that.
rather than using the workspace, did you try the ful path to the table
addTab = arcpy.mp.Table(r"C:\Projects\YosemiteNP\Data_Vector\YosemiteData.gdb\NHDFCode")
from the 2nd example in the help topic
Thanks for the suggestion Dan. Yes, I had tried that but it got me to go back and look at the full name and did lead me to find the problem, which was my fault. I was specifying the "short name" ('FieldShareLevel) instead of the full name (ROW_Habitat.SDE.FieldShareLevel). It seems a bit severe to be crashing for such a mistake, but... once I fixed that it works as expected - at least when called from the Python pane in ArcPro. Thanks again for the help.
I agree that crashing is a defect. If the name isn't complete, it should generate an error that can be recovered just like when you supply a non-existent name.
Spent 11 years only scripting for file geodatabases. Last three in sde. This still trips me up often.