Select to view content in your preferred language

Improve Usability of arcpy.da.walk

1674
4
07-05-2019 02:39 AM
Status: Implemented
Labels (1)
RichardHowe
Frequent Contributor

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!

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

KoryKramer
Status changed to: Implemented

This is implemented in ArcGIS Pro 3.3. See Your Ideas in ArcGIS Pro 3.3 for a full list of all user ideas you can look forward to! And be sure to check out the release blog and what’s new help topic and video to learn more about all the new features and functionality in the release.