Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve: SQL examples #2527

Merged
merged 11 commits into from
Oct 8, 2024
Merged

improve: SQL examples #2527

merged 11 commits into from
Oct 8, 2024

Conversation

akshayka
Copy link
Contributor

@akshayka akshayka commented Oct 8, 2024

Create a collection of bite-sized examples showing how to use SQL:

  • querying dataframes
  • parametrizing queries
  • read from CSV
  • read from JSON
  • read from parquet
  • connect to sqlite
  • connect to postgres

Verified

This commit was signed with the committer’s verified signature. The key has expired.
addaleax Anna Henningsen

Verified

This commit was signed with the committer’s verified signature. The key has expired.
addaleax Anna Henningsen
Copy link

vercel bot commented Oct 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
marimo-docs ❌ Failed (Inspect) Oct 8, 2024 1:04am
marimo-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 8, 2024 1:04am

@akshayka akshayka requested a review from mscolnick October 8, 2024 00:11


@app.cell
def __(db, duckdb_table, mo, test_table):
Copy link
Contributor

Choose a reason for hiding this comment

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

unrelated, but this import duckdb_table seems incorrect.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yea weird that it's a def and a ref ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The Python code has logic for not registering something as a ref if it's a def, SQL could be missing that

@app.cell(hide_code=True)
def __():
import marimo as mo
import pandas as pd
Copy link
Contributor

Choose a reason for hiding this comment

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

super nit; but i feel like we should use polars (instead of pandas) when possible

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yea i agree in general but i'd like to host these on WASM too

Copy link
Contributor

Choose a reason for hiding this comment

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

oh yes good call - we did discuss that

@akshayka akshayka merged commit f95333a into main Oct 8, 2024
21 of 22 checks passed
@akshayka akshayka deleted the aka/examples-sql branch October 8, 2024 04:08
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.

None yet

2 participants