mmayorga
Databricks Employee
Databricks Employee

 

hi @JuliandaCruz 

Thank you for reaching out!

I was able to reproduce your case while using Databricks Connect. The "Upload and Run file" option worked fine and returned results, which is essentially the same as running from the Databricks UI.

Though when running "Run current file with Databricks Connect", the same code returned no values. This option leverages a mix between your local environment and the one in the cluster, hence the importance of matching Python versions; however, I was unable to obtain results using "glob"; I couldn't find a specific reason or limitation.

You can follow the approach suggested by @dkushari , or a faster workaround would be to leverage:

- LIST command in SQL or dbutils.fs.ls in Python, which will return: path, name, size, and modification time

# Define Volume Path
volume_path =’'/Volumes/..."

# Get the Files from specified Volume
files = dbutils.fs.ls(volume_path)

# Parse and extract specific fields
# path, name, size, modification

# Print Results
print(files)

 I hope this works!

Thank you,