ArcPro crash calling arcpy.mp.Table

375
6
Jump to solution
01-09-2020 12:54 PM
DonMorrison1
Occasional Contributor III

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.

0 Kudos
1 Solution

Accepted Solutions
DonMorrison1
Occasional Contributor III

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.

View solution in original post

6 Replies
MatthewDriscoll
MVP Regular Contributor

In Catalog -> History does it create a log for the run?   

0 Kudos
DonMorrison1
Occasional Contributor III

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.

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

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

Table—ArcPy | ArcGIS Desktop 

0 Kudos
DonMorrison1
Occasional Contributor III

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.

JoshuaBixby
MVP Esteemed Contributor

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.

0 Kudos
MatthewDriscoll
MVP Regular Contributor

Spent 11 years only scripting for file geodatabases.  Last three in sde.  This still trips me up often.  

0 Kudos