Select to view content in your preferred language

arcpy.List* Methods Returning None or []

645
2
Jump to solution
09-21-2023 11:27 AM
RogerDunnGIS
Occasional Contributor II

I am working with ArcGIS Pro 3.1 Notebooks.  As the GIS Administrator, I have admin and read-only sde connection files to various enterprise geodatabases.  When I set arcpy.env.workspace to an admin connection file to one of these geodatabases, some List_ methods return None or [] when they, in fact, contain data that the admin can see.  In fact, the admin owns some of these feature classes.  I can see them fine in Catalog.

For example, an admin connection to a geodatabase full of rasters yields None when arcpy.ListRasters is called.  Or when using an admin to another admin connection, arcpy.ListFeatureClasses yields [].  However, when I set arcpy.env.workspace to a read-only connection file to these geodatabases, the arcpy.List_ methods return good data.

These enterprise geodatabases are at version 10.9.1.2.9.

What might explain why the List_ methods return None or [] when arcpy.env.workspace is set to an .sde file containing admin credentials, but contain good data when using an .sde file containing read-only credentials?

0 Kudos
1 Solution

Accepted Solutions
RogerDunnGIS
Occasional Contributor II

I'll probably scrap this idea and see how arcpy.da.Walk compares.  I'll let this thread know next week.

View solution in original post

0 Kudos
2 Replies
ShaunWalbridge
Esri Regular Contributor

Sounds like a possible bug. Might look at if the behavior is reproducible outside the application in a standalone script, and whether it is the same in standalone Jupyter notebook. If it reproduces in those environments, it is something fairly deep and not related to the particular application state of Pro.

0 Kudos
RogerDunnGIS
Occasional Contributor II

I'll probably scrap this idea and see how arcpy.da.Walk compares.  I'll let this thread know next week.

0 Kudos