Improve Usability of arcpy.da.walk

07-05-2019 02:39 AM
Status: Open
Labels (1)
Occasional Contributor II

The addition of the arcpy walk fuction at 10.1 was a great help in replacing the ListFeatureClasses and ListDatasets functionality which are incredibly slow for large numbers of datasets within a workspace.

However, the results of the walk are not particularly intelligent. They don't contain useful properties such as dataset type. Therefore to ascertain type you have to put a filter on the walk function (rather than filtering the results) which has a massively detrimental effect on speed.

For example when running on a sample gdb containing ~5000 datasets arcpy.da.walk will return a dataset list in approx. 10 seconds when run without a dataset type filter. However, once the filter is added to the walk it takes several hours (somewhat counter-intuitive as it returns a smaller list)!

There must be a way to quickly access this information without deep diving into every dataset (which is what I suspect it is doing), as ArcCatalog displays this information within seconds in the "Type" column.

It would be very useful to have a more efficient pythonic way to get at dataset type!

1 Comment

An additional piece of usability would be to all arcpy.da.walk to return workspaces within the top directory and allow us to specify which type of workspace we'd like returned (e.g. return only file geodatabases).