Improve Usability of arcpy.da.walk

1191
3
07-05-2019 02:39 AM
Status: In Product Plan
Labels (1)
RichardHowe
Occasional Contributor III

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!

3 Comments
AJR
by

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).

ShaunWalbridge
Status changed to: Under Consideration

This is valid, and thanks for bringing it to our attention. In the future, for issues of this nature (significant performance regression when asking for less data) are bugs and should be submitted via support requests. However given this has a number of Kudos and a clear story, keeping this idea open to track its progress. 

Cheers, Shaun

HannesZiegler
Status changed to: In Product Plan

We're working on this!  This status does not guarantee that the functionality will be in the next release, but development work has begun. Release cycles vary by product so make sure to check the product life cycle information to get an idea of when to expect the next release.