cancel
Showing results for 
Search instead for 
Did you mean: 
Administration & Architecture
Explore discussions on Databricks administration, deployment strategies, and architectural best practices. Connect with administrators and architects to optimize your Databricks environment for performance, scalability, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 

Databricks Workspace APIs

davide-maestron
New Contributor

Hello, I'm trying to collect metadata about the files stored in a Workspace Repo Folder, but it looks like the "size" field is always missing. The field is listed in a few SDKs (for example, in the Python documentation: https://databricks-sdk-py.readthedocs.io/en/latest/dbdataclasses/workspace.html#databricks.sdk.servi...), but even when using command line tools to invoke the API endpoint (like curl), no "size" is there in the json response.

Example of curl command line:

curl -H"Authorization: Bearer dapiXXXXX" "https://dbc-XXXX-XXX.cloud.databricks.com/api/2.0/workspace/get-status?path=%2FRepos%2F..."

Is that a bug on the server side? or is just a missing feature?

3 REPLIES 3

szymon_dybczak
Esteemed Contributor III

 

Hi @davide-maestron ,

Yep, it looks like a bug. According to docs, this attribute will be return only for files. 

szymon_dybczak_0-1755543613553.png

So I specifically provided a path to a file in my workspace and API didn't return size attribute:

szymon_dybczak_1-1755543650500.png

Edit: What's interesting is that documentation is saying that size attribute can be returned. I wonder what are the factors that cause this attribute to appear (if any) 😄



WiliamRosa
New Contributor II

@szymon_dybczak, Help me understand if this makes sense: what if I use the Files API instead of the Workspace API to get the size?

Wiliam Rosa
Data Engineer | Machine Learning Engineer
LinkedIn: linkedin.com/in/wiliamrosa

szymon_dybczak
Esteemed Contributor III

Hi @WiliamRosa ,

Good idea, but unfortunately Files API doesn't support Workspace as a valid input to directory_path query parameter

szymon_dybczak_0-1755548272236.png

 

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