Skip to content

Commit 0240593

Browse files
cdcadmanChuck Cadman
authored andcommitted
Refactor sqlalchemy code in pandas.io.sql to help prepare for sqlalchemy 2.0. (pandas-dev#49531)
* DOC: Clarify behavior of DataFrame.to_sql * CLN: Make SQLDatabase only accept a sqlalchemy Connection. Co-authored-by: Chuck Cadman <[email protected]>
1 parent 67dedc5 commit 0240593

File tree

3 files changed

+165
-161
lines changed

3 files changed

+165
-161
lines changed

pandas/core/generic.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -2751,8 +2751,11 @@ def to_sql(
27512751
Using SQLAlchemy makes it possible to use any DB supported by that
27522752
library. Legacy support is provided for sqlite3.Connection objects. The user
27532753
is responsible for engine disposal and connection closure for the SQLAlchemy
2754-
connectable See `here \
2755-
<https://docs.sqlalchemy.org/en/13/core/connections.html>`_.
2754+
connectable. See `here \
2755+
<https://docs.sqlalchemy.org/en/14/core/connections.html>`_.
2756+
If passing a sqlalchemy.engine.Connection which is already in a transaction,
2757+
the transaction will not be committed. If passing a sqlite3.Connection,
2758+
it will not be possible to roll back the record insertion.
27562759
27572760
schema : str, optional
27582761
Specify the schema (if database flavor supports this). If None, use

0 commit comments

Comments
 (0)