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")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.
Message
Section titled “Message”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.