feat(managed): add add_managed_table for additive schema evolution#32
Merged
Conversation
Wraps the SDK add_database_table endpoint so callers can declare a new table on an existing managed database without recreating it. The table is added empty (declared-but-unloaded) and populated via load_managed_table.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
HotdataClient.add_managed_table(database, table, *, schema), a thin wrapper over the SDK'sDatabasesApi.add_database_tableendpoint. It declares a new table on an existing managed database (added empty / declared-but-unloaded; populate viaload_managed_table).This unblocks additive schema evolution for downstream consumers (notably the dlt destination), which currently must snapshot every table, delete the whole managed database, recreate it with the union of tables, and reload all data just to add one table.
Changes
hotdata_framework/client.py: newadd_managed_tablemethod (mirrorsdelete_managed_table) +AddManagedTableRequestimport.tests/test_client.py: unit test asserting the endpoint is called with the right args and the response is mapped toManagedTable(synced=False, last_sync=None).CHANGELOG.md:[Unreleased]note.Verification
uv run pytest— all green (incl. new test).ruff check— clean.Follow-up
A release (minor bump) is needed so the dlt destination can pin the new version and drop its destructive-recreate workaround.