Why does arcpy.da.Describe return different keys for the same data based on location?

453
4
Jump to solution
11-28-2023 10:05 AM
DantePisani1
New Contributor

I have a file geodatabase on a remote desktop with the following layer: r'C:\Folder\Database.gdb\Feature_Dataset\Feature_Class'. If I copy this entire gdb to my local machine, da.Describe does not return the workspace property as it does on the remote desktop.

On the remote desktop:

desc = arcpy.da.Describe(r'C:\...\Folder\Database.gdb\FDataset\Feature_Class')
print('workspace' in desc.keys())
True

On my local desktop:

desc = arcpy.da.Describe(r'C:\...\Folder\Database.gdb\FDataset\Feature_Class')
print('workspace' in desc.keys())
False

This is from the python window in ArcGIS Pro 3.2 on my local desktop, and 3.1 on the remote. It's not just the workspace key that's different, though, and it makes it difficult to write python tools when the keys are different.

Is it because the remote desktop has enterprise? To be clear neither of these are sde databases - they're both file geodatabases.

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
Flann
by
New Contributor II

The  workspace property was added to the Describe results in version 3.2.
https://pro.arcgis.com/en/pro-app/latest/get-started/whats-new-in-arcgis-pro.htm

View solution in original post

4 Replies
RobBurke
New Contributor III

Hello,

Just as a diagnostic, in both places print out all the keys and values using pretty print.

import pprint
pprint.pprint(desc)

Compare the two outputs...

Robert Burke
0 Kudos
DanPatterson
MVP Esteemed Contributor

also, try datatype rather than your check

Workspace properties—ArcGIS Pro | Documentation

as in the code example above

desc.workspaceType

workspaceType
(Read Only)
Specifies the workspace type.

FileSystem—The workspace type is a file-based workspace (shapefile, coverage, and so on) or an in-memory workspace.
LocalDatabase—The workspace type is a local geodatabase (a file or personal geodatabase) or a memory workspace.
RemoteDatabase—The workspace type is a geodatabase that requires a remote connection (enterprise, OLE DB, and so on).


... sort of retired...
0 Kudos
Flann
by
New Contributor II

The  workspace property was added to the Describe results in version 3.2.
https://pro.arcgis.com/en/pro-app/latest/get-started/whats-new-in-arcgis-pro.htm

DantePisani1
New Contributor

Thank you very much.

0 Kudos