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
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of Polars.
Reproducible example
# my dataframedf=pl.DataFrame({'brand': ['Volvo', 'BMW', 'Toyota'], 'model': ['p1800', 'M1', 'Celica'], 'year': [1968, 1978, 1975]})
# this results in writing the dataframe to the public schemadf.write_database(table_name="sandbox.cars_output", connection=uri, engine="adbc", if_exists='replace')
Log output
No response
Issue description
When writing a dataframe to a Postgres database with pl.write_database using adbc, the specified schema don't get reflected in the result. It writes to the public schema instead. And the whole string I specify in the table_name parameter becomes the table name created in the public schema. But with sqlalchemy, it writes to the specified scheme with no problems.
Expected behavior
I expect the dataframe written to the specified schema, "sandbox", instead of the "public".
@stinodego might be a close, not sure if polars wants to take this on or leave to adbc and possibly connectorx or leave to user to augment their conn string.
I actually raised this issue with the adbc folks a while ago (end of September), and they have since both confirmed the bug and fixed it: apache/arrow-adbc#1109
If you install their recent 0.8.0 release (I see you're on 0.7.0) it'll work.
You should probably also update to the latest polars release 0.19.18, as I added some additional checks and affordances relating to adbc; for instance, if we see you relying on a db schema name with an adbc version below 0.8.0 we'll raise an error and tell you to go upgrade, eg:
ModuleNotFoundError("use of schema-qualified table names requires ADBC version >= 0.8, found 0.7.0")
Checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of Polars.
Reproducible example
Log output
No response
Issue description
When writing a dataframe to a Postgres database with
pl.write_database
using adbc, the specified schema don't get reflected in the result. It writes to the public schema instead. And the whole string I specify in thetable_name
parameter becomes the table name created in the public schema. But with sqlalchemy, it writes to the specified scheme with no problems.Expected behavior
I expect the dataframe written to the specified schema, "sandbox", instead of the "public".
Installed versions
The text was updated successfully, but these errors were encountered: