I'm trying to find feature datasets in file geodatabase (possibly many geodatabases, but for clarity here only one) using arcpy.da.Walk. I'm aware of workaround using ListDatasets and I'm aware of similiar topic (https://community.esri.com/t5/python-questions/arcpy-da-walk-workspace-datatype-quot/m-p/595010), but this one is from 2015. We have 2023, ArcGIS Pro 3.1 and it looks like it is still the same - arcpy.da.Walk doesn't detect feature datasets as feature datasets (it treats them as "folders")- or am I doing something wrong?
import os
workspace=r'E:\GIS_DATA\ArcGIS\TestWalk\TestWalk.gdb'
feature_datasets = []
walk = arcpy.da.Walk(workspace,datatype=["FeatureDataset"])
for dirpath, dirnames, filenames in walk:
print (dirpath,dirnames,filenames)
for filename in filenames:
feature_datasets.append(os.path.join(dirpath, filename))
print ("Found:{0}".format(feature_datasets))
This is my geodatabase structue:

This is the result of the script:
E:\GIS_DATA\ArcGIS\TestWalk\TestWalk.gdb ['DS1', 'DS2'] []
E:\GIS_DATA\ArcGIS\TestWalk\TestWalk.gdb\DS1 [] []
E:\GIS_DATA\ArcGIS\TestWalk\TestWalk.gdb\DS2 [] []
Found:[]