feat: managed database widgets for Marimo#5
Conversation
Add databases_panel and ManagedDatabaseWriter so notebooks can create Hotdata-owned catalogs and load parquet tables, with demo tab wiring and tests. Depends on hotdata-runtime feat/managed-databases until that lands on main and PyPI.
Replace git branch dependency with a PyPI version constraint aligned with the runtime release that adds managed database helpers.
| version = "0.1.0" | ||
| source = { registry = "https://pypi.org/simple" } | ||
| version = "0.1.1" | ||
| source = { editable = "../sdk-python" } |
There was a problem hiding this comment.
Blocking. The lockfile pins the hotdata (SDK) package to editable = "../sdk-python" (also at line 226), but that path is not declared anywhere in this repo's pyproject.toml [tool.uv.sources] (only hotdata-runtime = "../hotdata-runtime" is). This appears to have leaked in from hotdata-runtime's own local tool.uv.sources when the lockfile was regenerated against an editable runtime.
Anyone running uv sync from a fresh checkout that doesn't happen to also have ../sdk-python (a separate, undocumented repo) checked out will fail — including CI. Please regenerate the lockfile in an environment that resolves hotdata from PyPI, or document the required sibling checkouts in the README/CONTRIBUTING.
| license = { text = "MIT" } | ||
| dependencies = [ | ||
| "hotdata-runtime @ git+https://github.com/hotdata-dev/hotdata-runtime.git", | ||
| "hotdata-runtime>=0.1.1", |
There was a problem hiding this comment.
Blocking. This now declares hotdata-runtime>=0.1.1 as a regular dependency, but per the PR description the runtime PR (hotdata-runtime#4) has not merged and 0.1.1 is not on PyPI yet. The PR description says "This PR pins hotdata-runtime to @feat/managed-databases until that merges" — but the diff shows the git pin was already removed.
As-is, pip install hotdata-marimo will fail until runtime is published. Either:
- restore the
hotdata-runtime @ git+https://...@feat/managed-databasespin (and the corresponding[tool.hatch.metadata] allow-direct-references = true) until runtime is published, OR - hold this PR until
hotdata-runtime 0.1.1is on PyPI and update the PR description.
| schema="public", | ||
| tables=["orders", "customers"], | ||
| ) | ||
| assert "Created" in str(panel) or panel is not None |
There was a problem hiding this comment.
nit: (not blocking) assert "Created" in str(panel) or panel is not None is effectively a tautology — the right side is true whenever result_panel returns anything, which it always does on the success path. Since mo.callout/mo.md aren't patched in this test, you can drop the or clause (just assert "Created" in str(panel)) so the assertion actually verifies the success-branch rendered.
| options={db.name: db.name for db in dbs}, | ||
| label="Database", | ||
| full_width=True, | ||
| ) |
There was a problem hiding this comment.
nit: (not blocking) On a successful create, _rebuild_database_pick() replaces self.database with a fresh mo.ui.dropdown whose .value defaults to the first option. If the user had already picked a different database earlier in the session, that selection is silently dropped. Consider preserving the previously selected value when rebuilding (e.g., pass value=current_value if it's still in the new options).
There was a problem hiding this comment.
Review
Blocking Issues
uv.lock(line 173, 226): thehotdataSDK package is locked toeditable = "../sdk-python", an undocumented sibling checkout.uv syncwill fail for anyone (including CI) without that path.pyproject.toml(line 13):hotdata-runtime>=0.1.1is not yet on PyPI, and the PR description says the git pin should still be in place untilhotdata-runtime#4merges. As-is, installs will fail.
Action Required
- Either restore the
git+https://...@feat/managed-databasespin forhotdata-runtime(with[tool.hatch.metadata] allow-direct-references = true) until runtime is published, or hold this PR untilhotdata-runtime 0.1.1is on PyPI. - Regenerate
uv.lockin an environment that resolveshotdatafrom PyPI so the../sdk-pythoneditable source is removed.
Keep hotdata-runtime>=0.1.1, add explicit hotdata>=0.2.0, and regenerate uv.lock with hotdata from PyPI after merging publish.yml from master.
There was a problem hiding this comment.
Review
Status update from cycle 1:
- ✅ Resolved: lockfile no longer leaks the
hotdataeditable pin from../sdk-python—hotdata 0.2.0now resolves from PyPI. - ⛔ Still blocking:
hotdata-runtime>=0.1.1is declared as a regular dep but0.1.1is not yet on PyPI (pyproject.toml comment and the unchecked "Merge hotdata-runtime #4 first" item in the test plan both acknowledge this).pip install hotdata-marimowill fail until runtime publishes. This is the "hold this PR" option from the prior review — fine, but it means this PR must not merge untilhotdata-runtime 0.1.1is live on PyPI (and ideally the lockfile re-locked off PyPI rather than the editable sibling).
No new blocking findings beyond the carried-over Issue 2. Prior nits (test tautology, dropdown selection reset on rebuild) are not re-raised.
There was a problem hiding this comment.
All prior blocking issues from cycle 2 are resolved: uv.lock now resolves hotdata from PyPI (no more ../sdk-python editable pin), and the runtime-not-on-PyPI concern is handled by the explicit "merge hotdata-runtime #4 first" gate in the PR description plus the documented [tool.uv.sources] fallback for local dev.
Remove the editable sibling runtime override now that 0.1.1 is published, preserve database dropdown selection after create, and tighten the create success test assertion.
Summary
databases_panelandManagedDatabaseWriterfor creating managed databases and loading parquet tables from a Marimo notebookexamples/demo.pyand exportmo.ui.hotdata_*aliasesDependencies
hotdata-runtime>=0.1.1(published on PyPI)hotdata>=0.2.0Test plan
uv sync --locked(no sibling checkouts required)uv run pytest(61 passed)examples/demo.pywithHOTDATA_API_KEYset and exercise the Databases tab