Skip to content

polars/polars-sql-frame-globals

Pack Severity Fix Versions
Polars info none, edit by hand All versions

Polars sql resolves table names from Python globals. Use SQLContext with explicit table bindings when the query should depend on named inputs.

pl.sql("SELECT * FROM df")
pl.SQLContext(df=df).execute("SELECT * FROM df")

Implicit and explicit binding each returned 3 rows.

Edit the code using the replacement in the example.

Polars sql resolves table names from Python globals. Use SQLContext with explicit table bindings when the query should depend on named inputs.

See all rules in the Polars pack.