You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In builds subsequent to 10.2, names from the duckdb module appear to be shadowing Python variables when used in queries.
To Reproduce
When I use a variable name for a dataframe in an SQL query that happens to be the name of some function in the duckdb module, I run in to the following problem. I'm using the variable name "df" in this case but I could have use "pl" or "arrow" or many other to reproduce the same error.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/username/venv/lib/python3.12/site-packages/duckdb/__init__.py", line 455, in sql
return conn.sql(query, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
duckdb.duckdb.InvalidInputException: Invalid Input Error: Python Object "df" of type "builtin_function_or_method" found on line "/Users/username/venv/lib/python3.12/site-packages/duckdb/__init__.py:455" not suitable for replacement scans.
Make sure that "df" is either a pandas.DataFrame, duckdb.DuckDBPyRelation, pyarrow Table, Dataset, RecordBatchReader, Scanner, or NumPy ndarrays with supported format
When I use a variable name for the dataframe that is not visible in the duckdb module then there are no problems.
What happens?
In builds subsequent to 10.2, names from the duckdb module appear to be shadowing Python variables when used in queries.
To Reproduce
When I use a variable name for a dataframe in an SQL query that happens to be the name of some function in the duckdb module, I run in to the following problem. I'm using the variable name "df" in this case but I could have use "pl" or "arrow" or many other to reproduce the same error.
When I use a variable name for the dataframe that is not visible in the duckdb module then there are no problems.
OS:
MacOS Sonama 14.4.1 (silicon)
DuckDB Version:
0.10.3-dev777
DuckDB Client:
Python
Full Name:
David Brennan
Affiliation:
None
What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.
I have tested with a nightly build
Did you include all relevant data sets for reproducing the issue?
Yes
Did you include all code required to reproduce the issue?
Did you include all relevant configuration (e.g., CPU architecture, Python version, Linux distribution) to reproduce the issue?
The text was updated successfully, but these errors were encountered: