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")What the rule reports
Section titled “What the rule reports”Implicit and explicit binding each returned 3 rows.
How to fix it
Section titled “How to fix it”Edit the code using the replacement in the example.
Diagnostic message
Section titled “Diagnostic message”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.