cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Python os.listdir() behavior difference between 15.4LTS and 16.4LTS DBRs

nopal1
New Contributor II

We found that when using os.listdir() in Databricks notebooks to list files stored in the Workspace (i.e., alongside the notebook, not in DBFS), file extensions were missing in Databricks Runtime 14.3 LTS and 15.4 LTS, but appeared correctly in 16.4 LTS.

For example os.listdir('.') would return the following code for the different runtimes:

>>> os.listdir('.') # DBR 14.3LTS, DBR 15.4LTS
['notebookA', 'fileB', 'notebookc']

>>> os.listdir('.') # DBR 16.4LTS, Serverless compute
['notebookA.sql', 'fileB.py', 'notebookc.ipynb']

 On the code level we can handle this, but I'd like to understand and/or track down this breaking change between the different runtimes.

Can you help me with the reason?

1 ACCEPTED SOLUTION

Accepted Solutions

cgrant
Databricks Employee
Databricks Employee
2 REPLIES 2

cgrant
Databricks Employee
Databricks Employee

nopal1
New Contributor II

Thank you so much!

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now