Skip to content

Commit 5509eb6

Browse files
committed
docs: rename example to demo.py and document HOTDATA_WORKSPACE_ID
Rename hotdata_basic.py to demo.py with a minimal runnable flow including mo.sql, and update README/TODO for the canonical env var.
1 parent dd4e290 commit 5509eb6

3 files changed

Lines changed: 19 additions & 7 deletions

File tree

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Requires Python 3.10+, **Marimo**, and [**hotdata-runtime**](https://github.com/
1717
|----------|----------|-------------|
1818
| `HOTDATA_API_KEY` | Yes | API key for the Hotdata API |
1919
| `HOTDATA_API_URL` | No | API base URL (default: `https://api.hotdata.dev`) |
20-
| `HOTDATA_WORKSPACE` | No | Workspace id; if unset, the first active workspace is used |
20+
| `HOTDATA_WORKSPACE_ID` | No | Workspace public id; if unset, the first active workspace is used |
2121
| `HOTDATA_SANDBOX` | No | Sandbox session id, passed through to the SDK |
2222

2323
## Minimal notebook
@@ -45,16 +45,16 @@ Keep the editor in one cell and consume `editor.result` in another. The editor c
4545

4646
Marimo only shows **what you `return` from a cell**. Calling `mo.vstack(...)` or `hm.query_result(...)` without returning it produces no visible output.
4747

48-
See `examples/hotdata_basic.py` for a full runnable notebook flow.
48+
See `examples/demo.py` for a full runnable notebook flow.
4949

5050
## Examples
5151

52-
- `examples/hotdata_basic.py` — end-to-end browser + editor + result rendering flow.
52+
- `examples/demo.py` — end-to-end browser + editor + result rendering flow.
5353

5454
Run:
5555

5656
```bash
57-
uv run marimo edit examples/hotdata_basic.py --no-token
57+
uv run marimo edit examples/demo.py --no-token
5858
```
5959

6060
## Layout
@@ -68,7 +68,7 @@ This package depends on [**hotdata-runtime**](https://github.com/hotdata-dev/hot
6868
```bash
6969
uv sync --locked
7070
uv run pytest
71-
marimo edit examples/hotdata_basic.py --no-token
71+
marimo edit examples/demo.py --no-token
7272
```
7373

7474
To pin **hotdata-runtime** from Git instead of the sibling path, remove the `[tool.uv.sources]` block, set the dependency line as needed, and run `uv lock` again.

TODO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Near term (build on MVP)
44

5-
- [x] **Workspace selector** — When `HOTDATA_WORKSPACE` is unset and multiple workspaces exist, expose `mo.ui.dropdown` (or similar) and rebuild the client when the choice changes.
5+
- [x] **Workspace selector** — When `HOTDATA_WORKSPACE_ID` is unset and multiple workspaces exist, expose `mo.ui.dropdown` (or similar) and rebuild the client when the choice changes.
66
- [x] **Connection status** — Small status chip (API reachable, workspace id, optional sandbox) using a lightweight health or `workspaces`/`connections` probe.
77
- [ ] **Query cancel** — Wire cancel to the query-run API if/when exposed in the OpenAPI client; surface a Cancel control next to Run.
88
- [x] **`mo.ui.hotdata_*` aliases** — Re-export or thin wrappers: `hotdata_sql_editor`, `hotdata_table_browser`, `hotdata_query_result`, `hotdata_connection_picker` for discoverability.

examples/demo.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ def _():
1212

1313
import hotdata_marimo as hm
1414

15+
hm.register_hotdata_sql_engine()
1516
return hm, mo, os
1617

1718

@@ -42,7 +43,7 @@ def _(hm, workspace):
4243
)
4344
recent = hm.recent_results(client, limit=20)
4445
history = hm.run_history(client, limit=10)
45-
return browser, editor, history, recent, status, workspace
46+
return browser, client, editor, history, recent, status, workspace
4647

4748

4849
@app.cell
@@ -79,5 +80,16 @@ def _(hm, recent):
7980
return hm.query_result(recent.result, label="Recent result"), _selected
8081

8182

83+
@app.cell
84+
def _(client, mo):
85+
_df = mo.sql(
86+
"""
87+
SELECT 1 AS example_value
88+
""",
89+
engine=client,
90+
)
91+
return
92+
93+
8294
if __name__ == "__main__":
8395
app.run()

0 commit comments

Comments
 (0)