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
{{ message }}
Repository navigation
Commit d1d6a1c
Browse filesBrowse the repository at this point in the historyBrowse files
HotdataClient no longer accepts session_id=, the session_id property is gone,
default_session_id() and the HOTDATA_SANDBOX read are removed, the workspace
helpers lose their session_id parameter, and health output no longer emits a
sandbox line.
The server stopped enforcing session scoping some time ago, so the value
already reached nothing. What makes removal necessary rather than tidy is that
the SDK is dropping the SessionId security scheme: against that release
Configuration(session_id=...) raises TypeError instead of setting a header, and
this package passed it unconditionally -- so every HotdataClient(...) would
fail at construction. Measured against hotdata built from sdk-python@main, this
suite goes to 97 failed / 28 passed before this change.
The dependency is capped at hotdata<0.9, so nothing is broken today. This is
what lets the cap be raised later without a second breaking release.
TESTS ASSERT THE WIRE, NOT THE SIGNATURE. The first version of these tests was
close to worthless, and a sabotage audit proved it: reviving the whole feature
from the ENVIRONMENT -- read HOTDATA_SANDBOX, pass it to Configuration, restore
the property and the health line -- left the suite fully green. A signature
check cannot see that, because no signature changes.
So the assertions are on Configuration.api_keys, which is where the generated
client records the schemes it will attach, and HOTDATA_SANDBOX is set
deliberately in each test so an environment-sourced revival has something to
find. Three sabotages that previously passed now fail:
revive from the environment 0 -> 4 failures
session_id back as a 3rd positional 0 -> 1 failure
leave from_env's body stale 0 -> 1 failure
Specific repairs to the earlier tests:
* the `sandbox` assertion was dead -- it built a client with no session, so on
an honest revert the `if client.session_id:` guard was false and nothing was
emitted. It now sets the env var, which is the only way the assertion is
reachable.
* pytest.raises(TypeError) had no match=, so it passed for any unrecognised
keyword. It was a typo detector.
* from_env's body had no coverage at all -- the module-level test patches the
classmethod out -- while this change rewrote two of its lines. It now
asserts pick_workspace is called with exactly two positional arguments.
* list_workspaces builds its own Configuration, a second place the header can
return, and the pre-auth one. Covered separately.
Also drops "session" from the package description, which ships to PyPI.
125 -> 130 passed. ruff and mypy counts unchanged from main (2 and 158, both
pre-existing; CI runs pytest only).
Review follow-ups: assert on the resulting Configuration rather than the kwargs
it was handed, because Configuration(api_keys={"SessionId": ...}) is a
documented escape hatch that re-attaches the header with no session_id keyword
at all -- a kwargs-only check waved it through. Sabotaged that exact vector: 3
tests now fail on it. Also switched to the public client.api.configuration
accessor instead of reaching into _config.
Copy file name to clipboardExpand all lines: CONTRACT.md
+1-3Lines changed: 1 addition & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,6 @@ The supported import surface is:
21
21
-`workspace_health_lines`
22
22
-`default_api_key`
23
23
-`default_host`
24
-
-`default_session_id`
25
24
-`explicit_workspace_id`
26
25
-`list_workspaces`
27
26
-`normalize_host`
@@ -43,7 +42,7 @@ Adapters should import from `hotdata_framework` and treat this surface as the st
43
42
44
43
### `HotdataClient`
45
44
46
-
- Represents runtime context: API key, host, workspace, optional session.
45
+
- Represents runtime context: API key, host, workspace.
47
46
-`from_env()` resolves runtime context from env vars and selected workspace.
48
47
-`execute_sql(sql)` returns `QueryResult` or raises `RuntimeError`/`TimeoutError`.
49
48
-`get_result(result_id)` returns a ready `QueryResult` and waits for readiness when needed.
@@ -79,7 +78,6 @@ Adapters should import from `hotdata_framework` and treat this surface as the st
79
78
80
79
-`default_api_key()` reads `HOTDATA_API_KEY`.
81
80
-`default_host()` reads `HOTDATA_API_URL` (default: `https://api.hotdata.dev`) and normalizes it.
82
-
-`default_session_id()` reads `HOTDATA_SANDBOX`.
83
81
-`explicit_workspace_id()` reads `HOTDATA_WORKSPACE` (workspace public id).
84
82
-`pick_workspace()` prefers explicit env workspace, then active workspace, then first workspace.
85
83
-`resolve_workspace_selection()` is the canonical workspace selection algorithm. It returns `WorkspaceSelection` with selected workspace id, selection source, and discovered workspaces when auto-selected.
Copy file name to clipboardExpand all lines: README.md
+2-3Lines changed: 2 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,15 +2,14 @@
2
2
3
3
**A Python framework for building Hotdata integrations.**
4
4
5
-
Shared runtime primitives for Hotdata integrations: workspace/session semantics, execution context, query state, run history, and replayable result handles. Framework packages (Marimo, Jupyter, Streamlit, LangGraph) depend on this package.
5
+
Shared runtime primitives for Hotdata integrations: workspace semantics, execution context, query state, run history, and replayable result handles. Framework packages (Marimo, Jupyter, Streamlit, LangGraph) depend on this package.
6
6
7
7
Runtime boundary and guarantees are defined in `CONTRACT.md`.
8
8
9
9
## Features
10
10
11
-
-**Environment-driven client setup** — create clients from `HOTDATA_API_KEY`, optional `HOTDATA_API_URL`, `HOTDATA_WORKSPACE`, and `HOTDATA_SANDBOX`.
11
+
-**Environment-driven client setup** — create clients from `HOTDATA_API_KEY`, optional `HOTDATA_API_URL`, and `HOTDATA_WORKSPACE`.
12
12
-**Workspace resolution** — choose an explicit workspace from env, otherwise discover workspaces and select the active workspace or first available workspace.
13
-
-**Sandbox/session propagation** — pass sandbox session context through the SDK via `X-Session-Id`.
14
13
-**HTTP resilience** — configure SDK retries for transient connection failures and retry SQL execution on stale pooled sockets.
15
14
-**SQL execution helper** — run SQL through `POST /v1/query`, poll async query runs when needed, and return a `QueryResult`.
16
15
-**Result utilities** — convert query results to records, pandas DataFrames, or metadata dictionaries for adapter display layers.
0 commit comments