Getting A List of Folders and Delta Tables in the Fabric Lakehouse
When you are working with the files and folders in Fabric, you will often need the list of file folders and tables for parameterization, data validation, DataOps, pipeline orchestration etc. Below is a quick helper function I have been using to get a list of all the folders and the tables as pandas dataframe along with the abfss file paths. Very handy when working on large projects. You can extend further if you need to get to the sub-folders in the Files section.
Here is the returned dataframe:
Please note that the spark configuration instead of using fabric uses trident which was the code name. This might change in the future, so refer to the official documentation.