Skip to content

Use runtime workspace resolver in Marimo#1

Merged
eddietejeda merged 16 commits into
masterfrom
feat/use-runtime-workspace-selection
May 17, 2026
Merged

Use runtime workspace resolver in Marimo#1
eddietejeda merged 16 commits into
masterfrom
feat/use-runtime-workspace-selection

Conversation

@eddietejeda
Copy link
Copy Markdown
Contributor

Summary

  • replace duplicated workspace-selection branching in WorkspaceSelector with resolve_workspace_selection() from hotdata-runtime
  • keep Marimo focused on UI behavior while runtime owns default workspace semantics
  • preserve existing explicit-workspace and dropdown behavior using runtime-provided selection outputs

Test plan

  • uv run pytest

Remove duplicated workspace selection branching in hotdata-marimo and delegate default selection semantics to hotdata-runtime.
claude[bot]
claude Bot previously approved these changes May 14, 2026
Capture transitive lockfile changes from the local hotdata-runtime source so the marimo dev environment remains reproducible.
Disambiguate duplicate labels for recent results and connection dropdowns so entries are never dropped, and add tests for both mappings.
claude[bot]
claude Bot previously approved these changes May 15, 2026
…act.

Switch modules to root hotdata_runtime imports and pass selected connection_id when resolving table columns to avoid ambiguous connection-name lookups.
claude[bot]
claude Bot previously approved these changes May 15, 2026
Replace direct SDK-shape handling with runtime list and metadata helpers, and add a guardrail test to keep package imports on the root runtime contract surface.
Comment on lines 34 to +51
@@ -52,10 +45,10 @@ def __init__(
seen.add(base)
labels.append((label_text, w.public_id))

labels.sort(key=lambda t: 0 if t[1] == chosen.public_id else 1)
labels.sort(key=lambda t: 0 if t[1] == selection.workspace_id else 1)
options = {k: v for k, v in labels}
self._pick = mo.ui.dropdown(options=options, label=label, full_width=True)
self._workspace_id = chosen.public_id
self._workspace_id = selection.workspace_id
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nit: the prior code raised RuntimeError("No Hotdata workspaces found for this API key.") before reaching the picker logic. With this refactor, if resolve_workspace_selection returns source != "explicit_env" with an empty workspaces list, neither branch fires and we fall through to build a dropdown with options={} (and selection.workspace_id is whatever the runtime defaulted it to). Either confirm the runtime contract guarantees a non-empty list / raises for this case, or restore an explicit guard here so the failure mode stays a clear error rather than a broken dropdown. (not blocking)

Comment thread hotdata_marimo/table_browser.py
Comment thread tests/test_architecture_guardrails.py Outdated
claude[bot]
claude Bot previously approved these changes May 15, 2026
Extend architecture checks to flag both from-import and import-as submodule patterns so marimo stays on the runtime root contract surface.
claude[bot]
claude Bot previously approved these changes May 15, 2026
Add an explicit examples section with a runnable command so users can quickly discover and launch the notebook integration flow.
claude[bot]
claude Bot previously approved these changes May 15, 2026
Keep marimo runtime checks aligned with the single HOTDATA_API_KEY environment contract.
claude[bot]
claude Bot previously approved these changes May 15, 2026
Use a portable default query and return rendered UI/results so the single documented example works out of the box.
claude[bot]
claude Bot previously approved these changes May 16, 2026
Show workspace selection, connection status, table browsing, SQL execution, run history, and recent-result loading in one runnable notebook.
claude[bot]
claude Bot previously approved these changes May 16, 2026
Register a Marimo SQL engine backed by HotdataClient, including
catalog introspection for the Data Sources panel and a display-name
patch so the connection shows as Hotdata in the UI.
Expose HotdataMarimoEngine and register_hotdata_sql_engine from the
top-level package and extend import tests.
Rename hotdata_basic.py to demo.py with a minimal runnable flow
including mo.sql, and update README/TODO for the canonical env var.
Align marimo README and TODO with the canonical workspace env var.
Comment thread hotdata_marimo/sql_engine.py Outdated
Comment thread hotdata_marimo/sql_engine.py Outdated
Comment thread hotdata_marimo/sql_engine.py
claude[bot]
claude Bot previously approved these changes May 17, 2026
Document the widget helpers, mo.sql engine integration, catalog browsing, and display helpers exposed by the Marimo adapter.
claude[bot]
claude Bot previously approved these changes May 17, 2026
Avoid importing SDK model types through transitive dependencies and cache connection listings during catalog discovery.
Comment thread hotdata_marimo/sql_engine.py
@eddietejeda eddietejeda merged commit 538b292 into master May 17, 2026
1 check 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