Databricks Workspace APIs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2025 10:09 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2025 12:01 PM - edited 08-18-2025 12:04 PM
Hi @davide-maestron ,
Yep, it looks like a bug. According to docs, this attribute will be return only for files.
So I specifically provided a path to a file in my workspace and API didn't return size attribute:
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) 😄
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2025 12:45 PM
@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?
Data Engineer | Machine Learning Engineer
LinkedIn: linkedin.com/in/wiliamrosa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2025 01:21 PM
Hi @WiliamRosa ,
Good idea, but unfortunately Files API doesn't support Workspace as a valid input to directory_path query parameter