-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH: Add table prefixes to to_sql method #60409
base: main
Are you sure you want to change the base?
Conversation
…andas into table_prefixes
Thanks for the PR, but this seems to only work with SQLAlchemy, meaning we won't get the same behavior for our ADBC drivers. I don't think this is worth pursuing unless there is a way to avoid fragmenting features across those two different areas |
I took a look into the ADBC implementation. |
I did some testing and was able to implement the feature partially for Now the question is:
I personally prefer the first option, because I connect to |
Can you check if there is an open issue for this upstream in the arrow-adbc repository? I think it may be of interest to them to handle more than just the temporary case. ADBC releases are pretty quick, so if that is implemented upstream it benefits the entire ecosystem, and likely wouldn't be a long turnaround to get into pandas |
That is a very good point. It wold be very beneficial, if both |
It looks like the
@WillAyd What are your thoughts on this? |
I don't think its worth adding to pandas if the various backends cannot both fully support it; we may have to document instead how you could do it with more low-level SQLAlchemy operations, but to have the pandas API only offer this for SQLAlchemy but not ADBC makes the abstraction of the pandas API more complicated |
And what about a reduced parameter |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.This PR adds a
prefixes
parameter to theto_sql
method and passes it down to the underlyingsqlalchemy.Table
class. It takes into account that temporary tables are not stored in a database's meta data and adds temporary table specific methods for_exists_temporary
and_drop_temporary_table
.Unfortunately, temporary tables don't work with null pooling, so I had to create additional sqlalchemy fixtures with the default pooling.
TODO:
SQLDatabase.check_case_sensitive
checks the databases's meta data. It will never find a temporary table and always throw a Warning. - I disabled case sensitivity checks for temporary tables.