Skip to content

polars/polars-sql-frame-globals

Rule polars-sql-frame-globals
Pack Polars
Severity info
Fix none, edit by hand
Library versions every version

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.

xpd prints this message with the issue. A name that starts with $ stands for code from your file.

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

Browse the other rules of the Polars pack.