AnsweredAssumed Answered

How to use Arcpy to access feature classes outside of feature datasets in an sde connection?

Question asked by spatial_andrewC on Dec 9, 2019



I'm finding that python is crashing each time I request feature classes using ArcPy when the default workspace is set to an sde connection. I have feature classes that are not within feature datasets. Currently, the only way that I am able to access these feature classes outside of the feature datasets is by using the following code:


for root, dirs, datasets in arcpy.da.Walk(workspace):

      for ds in datasets:

            print(os.path.join(root, ds))


However, this returns every item in the sde which is far more than I need and when I put a datatype filter in the Walk method it crashes the program (i.e. datatype = 'FeatureClass').


ArcPy also crashes when I run arcpy.ListFeatureClasses() with the sde workspace set to default. 


Am I missing something obvious?


Any insight would be really appreciated.