Use runtime workspace resolver in Marimo#1
Merged
Conversation
Remove duplicated workspace selection branching in hotdata-marimo and delegate default selection semantics to hotdata-runtime.
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.
…act. Switch modules to root hotdata_runtime imports and pass selected connection_id when resolving table columns to avoid ambiguous connection-name lookups.
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 | |||
There was a problem hiding this comment.
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)
Extend architecture checks to flag both from-import and import-as submodule patterns so marimo stays on the runtime root contract surface.
Add an explicit examples section with a runnable command so users can quickly discover and launch the notebook integration flow.
Keep marimo runtime checks aligned with the single HOTDATA_API_KEY environment contract.
Use a portable default query and return rendered UI/results so the single documented example works out of the box.
Show workspace selection, connection status, table browsing, SQL execution, run history, and recent-result loading in one runnable notebook.
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.
Document the widget helpers, mo.sql engine integration, catalog browsing, and display helpers exposed by the Marimo adapter.
Avoid importing SDK model types through transitive dependencies and cache connection listings during catalog discovery.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
WorkspaceSelectorwithresolve_workspace_selection()fromhotdata-runtimeTest plan
uv run pytest