You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(managed): carry X-Database-Id on result reads; keep API error bodies (#35)
fetch_table submitted the query WITH the database scope (x_database_id)
but then polled the stored result, polled the query run, and fetched the
Arrow body WITHOUT it. Results of database-scoped queries are themselves
database-scoped, so the results endpoints 400 ("X-Database-Id header is
required: this endpoint is scoped to a database") on every read against
an existing synced table — merge/append loads and dlt state restore
failed on any second run into the same database (dlthubworker#70), while
first runs passed because the unsynced-table guard short-circuits before
querying.
- _wait_result_ready / _await_query_run take the database_id and pass it
via the generated methods' _headers.
- The Arrow helper has no per-call headers, so _fetch_result_arrow sets
a scoped default header for the duration of the call and removes it
after (this client is not shared across threads).
- classify_sdk_error / api_error_message now append the response body
(flattened, 500-char cap): the body is where the API explains itself,
and dropping it made this bug a bare "400: Bad Request" for a week.
Verified live against api.hotdata.dev: the previously-failing state-table
append path (fetch -> concat -> load) now completes.
Co-authored-by: Eddie A Tejeda <669988+eddietejeda@users.noreply.github.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
8
8
## [Unreleased]
9
9
10
+
### Fixed
11
+
12
+
-`ManagedDatabaseClient.fetch_table` now carries the `X-Database-Id` scope header on the result poll, the query-run poll, and the Arrow fetch — not only on the query submit. Results of database-scoped queries are themselves database-scoped, so every read against an existing synced table (merge/append loads, dlt state restore) failed with `400: Bad Request` once the table had data (dlthubworker#70).
13
+
- API error messages now include the response body (flattened, truncated to 500 chars). `400: Bad Request` alone hid the server's actual explanation.
0 commit comments