Skip to content

feat: add per-load key to load_managed_table - #49

Merged
shefeek-jinnah merged 2 commits into
mainfrom
feat/per-load-key
Jul 20, 2026
Merged

feat: add per-load key to load_managed_table#49
shefeek-jinnah merged 2 commits into
mainfrom
feat/per-load-key

Conversation

@shefeek-jinnah

@shefeek-jinnah shefeek-jinnah commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

What

Adds an optional key argument to load_managed_table (on both ManagedDatabaseClient and RuntimeClient), forwarded into LoadManagedTableRequest.key. This lets delete/update/upsert loads carry their merge key per-load instead of requiring it to be declared at table creation. Omit key to use the table's declared key; ignored for replace/append (fully backward compatible).

client.load_managed_table("db", "orders", schema="public", upload_id=u, mode="delete", key=["id"])

Depends on

hotdata>=0.8.0 (adds the key field to LoadManagedTableRequest). ✅ Published to PyPI, and uv.lock is locked to it in this PR.

Part of the per-load-key chain

runtimedb (server, merged & deployed) → hotdata 0.8.0 (merged & published) → this PRhotdata-dlt-destination (connector, next). A follow-up release PR bumps this package 0.7.3 → 0.8.0.

Tests

  • test_load_managed_table_forwards_key — the key is forwarded through ManagedDatabaseClient to the runtime client.
  • test_load_managed_table_passes_key / test_load_managed_table_key_defaults_to_none — the key flows into LoadManagedTableRequest and defaults to None when omitted.
  • Full suite passes (green in CI: Test (Python 3.12), changelog check, review). Verified locally against hotdata 0.8.0.

load_managed_table gains an optional `key` — the merge key columns for
delete/update/upsert loads, matched per-load instead of requiring a key
declared at table creation. Omit it to use the table's declared key;
ignored for replace/append. Requires hotdata>=0.8.0, which adds the
`key` field to the load-request model.
claude[bot]
claude Bot previously approved these changes Jul 20, 2026

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean, focused change. key is threaded consistently through both the runtime and managed clients (mirroring mode), tests cover forwarding at both layers plus the default-None case, and CHANGELOG/dependency bump are handled. LGTM.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean, well-tested passthrough of the per-load key. Threaded correctly through both client layers, defaults to None, retry semantics unchanged, and covered at both levels. LGTM.

@shefeek-jinnah
shefeek-jinnah merged commit 4f3769d into main Jul 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant