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

SQL cell stopped executing replacement scans properly with DuckDB 1.10 #2272

Closed
ben-pr-p opened this issue Sep 9, 2024 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@ben-pr-p
Copy link

ben-pr-p commented Sep 9, 2024

Describe the bug

Screenshot 2024-09-09 at 11 50 25 AM

At first I thought the problem occurred only when I run uv run marimo edit, but then I realized the difference is actually what DuckDB version I have installed. After upgrading my global installation, I got the bug again with uv.

Environment

marimo env: (no bug)

{
  "marimo": "0.8.13",
  "OS": "Darwin",
  "OS Version": "23.6.0",
  "Processor": "arm",
  "Python Version": "3.8.13",
  "Binaries": {
    "Browser": "119.0.6045.123",
    "Node": "v18.17.0"
  },
  "Dependencies": {
    "click": "8.1.7",
    "importlib-resources": "6.1.1",
    "jedi": "0.19.1",
    "markdown": "3.5.2",
    "pygments": "2.17.2",
    "pymdown-extensions": "10.7",
    "ruff": "0.5.5",
    "starlette": "0.36.1",
    "tomlkit": "0.12.3",
    "typing-extensions": "4.12.2",
    "uvicorn": "0.27.0",
    "websockets": "12.0"
  },
  "Optional Dependencies": {
    "altair": "5.4.0",
    "duckdb": "0.9.2",
    "pandas": "2.0.3",
    "polars": "0.20.6",
    "pyarrow": "15.0.0"
  }
}

uv run marimo env: (bug occurs)

{
  "marimo": "0.8.13",
  "OS": "Darwin",
  "OS Version": "23.6.0",
  "Processor": "arm",
  "Python Version": "3.12.4",
  "Binaries": {
    "Browser": "119.0.6045.123",
    "Node": "v18.17.0"
  },
  "Dependencies": {
    "click": "8.1.7",
    "importlib-resources": "missing",
    "jedi": "0.19.1",
    "markdown": "3.7",
    "pygments": "2.18.0",
    "pymdown-extensions": "10.9",
    "ruff": "0.6.4",
    "starlette": "0.38.5",
    "tomlkit": "0.13.2",
    "typing-extensions": "4.12.2",
    "uvicorn": "0.30.6",
    "websockets": "12.0"
  },
  "Optional Dependencies": {
    "altair": "5.4.1",
    "anywidget": "0.9.13",
    "duckdb": "1.1.0",
    "pandas": "2.2.2",
    "polars": "1.6.0",
    "pyarrow": "17.0.0"
  }
}

marimo env: (after DuckDB upgrade, bug occurs)

{
  "marimo": "0.8.13",
  "OS": "Darwin",
  "OS Version": "23.6.0",
  "Processor": "arm",
  "Python Version": "3.8.13",
  "Binaries": {
    "Browser": "119.0.6045.123",
    "Node": "v18.17.0"
  },
  "Dependencies": {
    "click": "8.1.7",
    "importlib-resources": "6.1.1",
    "jedi": "0.19.1",
    "markdown": "3.5.2",
    "pygments": "2.17.2",
    "pymdown-extensions": "10.7",
    "ruff": "0.5.5",
    "starlette": "0.36.1",
    "tomlkit": "0.12.3",
    "typing-extensions": "4.12.2",
    "uvicorn": "0.27.0",
    "websockets": "12.0"
  },
  "Optional Dependencies": {
    "altair": "5.4.0",
    "duckdb": "1.1.0",
    "pandas": "2.0.3",
    "polars": "0.20.6",
    "pyarrow": "15.0.0"
  }
}

Code to reproduce

import marimo

__generated_with = "0.8.13"
app = marimo.App(width="medium")


@app.cell
def __():
    import marimo as mo
    import pandas as pd
    return mo, pd


@app.cell
def __(pd):
    recruitment_text_conversations = pd.DataFrame([{"a": 1}, {"a": 2}])
    return recruitment_text_conversations,


@app.cell
def __(mo, recruitment_text_conversations):
    _df = mo.sql(
        f"""
        SELECT * FROM recruitment_text_conversations
        """
    )
    return


if __name__ == "__main__":
    app.run()
@ben-pr-p ben-pr-p added the bug Something isn't working label Sep 9, 2024
@mscolnick
Copy link
Contributor

I can repro this. What is odd is that duckdb.sql directly works, but mo.sql does not, which just calls duckdb.sql. My guess is it has something to do with python globals() that it normally picks up

image

@akshayka
Copy link
Contributor

This is fixed by #2279 — thanks for reporting. It'll be up on PyPI within 20 minutes as 0.8.14.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants