Snippets were plain Python dicts — marimo expects actual notebook files (marimo.App with @app.cell). Rewrote all 10 as proper marimo notebooks that load_app() can parse. Disabled include_default_snippets — only our project snippets show. 10 snippets: duckdb, trino, bib, nessie, s3-obstore, chart-bar, chart-line, query-demographics, query-schema, query-pmpm. refs #75
39 lines
659 B
Python
39 lines
659 B
Python
import marimo
|
|
|
|
__generated_with = "0.20.4"
|
|
app = marimo.App()
|
|
|
|
|
|
@app.cell
|
|
def _(mo):
|
|
mo.md(r"""
|
|
# Query: Patient demographics
|
|
|
|
Summarise patient demographics by sex, race, and state.
|
|
""")
|
|
return
|
|
|
|
|
|
@app.cell
|
|
def _(mo, q):
|
|
demographics = q('''
|
|
SELECT sex, race, state, count(*) AS patients,
|
|
round(avg(age), 1) AS avg_age
|
|
FROM core.patient
|
|
GROUP BY sex, race, state
|
|
ORDER BY patients DESC
|
|
''')
|
|
mo.ui.table(demographics, label="Patient Demographics")
|
|
return (demographics,)
|
|
|
|
|
|
@app.cell
|
|
def _():
|
|
import marimo as mo
|
|
|
|
return (mo,)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
app.run()
|