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.
Solved! Go to Solution.
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
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...
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).
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
Thank you very much.