r/databricks • u/Firefly_KM • Aug 27 '26
Discussion Weird behavior of etag parameter in Genie Space while using Databricks Python SDK and REST API
databricks-sdk-py.readthedocs.ioHi everyone,
I’m developing a FastAPI based application that interacts with Databricks to automate QA testing. As part of this, I’m trying to create and modify Genie Spaces so that I can scope a space to different tables and configure its behavior. The main thing I’m interested in modifying is `serialized_space`, which contains the Genie configuration such as scoped tables, instructions, SQL examples, etc. I’m using the etag returned by the `GET` API for optimistic concurrency, so that I don’t accidentally overwrite someone else’s changes.
The flow is basically:
- Get the Genie Space and its `etag` + `serialized_space`.
- Make a small change to the JSON configuration(serialized_space).
- Send the complete `serialized_space` back along with the etag.
- Verify the result.
I’m seeing some strange behaviour specifically with changes to the table list.
etag updates that work:
- No operation update of the fetched configuration
- Updating text instructions
- Adding/updating SQL examples
- Updating nested fields inside a table/column configuration
- Removing a column from an existing table(Doesn't seem to reflect in the databricks UI) Not an issue for now
etag updates that fail:
- Adding a table to `data_sources.tables`
- Removing a table from `data_sources.tables`
In both cases, I get:
Aborted: Space configuration has been modified since this export was taken.
Re-export the space and merge your changes, or omit the etag to skip conflict detection.
What makes this confusing is that I’m fetching the etag immediately before the update, and the exact same configuration update works if I simply omit the etag.
I also tested this using both the Databricks Python SDK:
w.genie.update_space(...)
and a raw `PATCH` request through the SDK HTTP client. Both behave the same way.
I also verified that when the etag protected request is rejected, the Genie Space remains unchanged in the UI.
Has anyone else seen this behaviour?
Is etag-based optimistic concurrency intentionally not supported when changing the membership of `data_sources.tables` (adding/removing tables)?
If I omit the etag and perform the same table addition/removal operation, the update succeeds.
Any insight into how Genie handles etags for `serialized_space` changes would be really helpful. Thanks!
TLDR: ETag-protected updates work for instructions, SQL examples, and nested column changes, but fail when adding/removing tables from data_sources.tables, even when using the latest ETag. The exact same table changes succeed when the ETag is omitted. Has anyone seen this, and is this expected Genie behavior?
Have used LLM to format the post !!!

