From f080f98a74303af3fa6fedd7c05d4ed19a806bd5 Mon Sep 17 00:00:00 2001 From: Mike Robinson Date: Sat, 2 Nov 2019 15:38:33 +0000 Subject: [PATCH 1/3] Add documentation linking to sqlalchemy --- pandas/core/generic.py | 4 ++++ pandas/io/sql.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index f88c26c7bc782..3ba805fa71e8a 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -2646,6 +2646,10 @@ def to_sql( con : sqlalchemy.engine.Engine or sqlite3.Connection Using SQLAlchemy makes it possible to use any DB supported by that library. Legacy support is provided for sqlite3.Connection objects. + + Closing the connection is handled by the SQLAlchemy Engine. See `here \ + `_ + schema : str, optional Specify the schema (if database flavor supports this). If None, use default schema. diff --git a/pandas/io/sql.py b/pandas/io/sql.py index e90e19649f645..57e9ae3de6b67 100644 --- a/pandas/io/sql.py +++ b/pandas/io/sql.py @@ -362,6 +362,10 @@ def read_sql( Using SQLAlchemy makes it possible to use any DB supported by that library. If a DBAPI2 object, only sqlite3 is supported. + + Closing the connection is handled by the SQLAlchemy Engine. See `here \ + `_ + index_col : string or list of strings, optional, default: None Column(s) to set as index(MultiIndex). coerce_float : boolean, default True From b8d420945d54e9e6ae6aa6f436a511e0721d3961 Mon Sep 17 00:00:00 2001 From: Mike Date: Wed, 6 Nov 2019 19:56:06 +0000 Subject: [PATCH 2/3] Update docs --- pandas/core/generic.py | 6 +++--- pandas/io/sql.py | 8 +++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 3ba805fa71e8a..6272ffae342c8 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -2645,9 +2645,9 @@ def to_sql( Name of SQL table. con : sqlalchemy.engine.Engine or sqlite3.Connection Using SQLAlchemy makes it possible to use any DB supported by that - library. Legacy support is provided for sqlite3.Connection objects. - - Closing the connection is handled by the SQLAlchemy Engine. See `here \ + library. Legacy support is provided for sqlite3.Connection objects. The user + is responsible for engine disposal and connection closure for the SQLAlchemy + connectable See `here \ `_ schema : str, optional diff --git a/pandas/io/sql.py b/pandas/io/sql.py index 57e9ae3de6b67..2eed02c62422c 100644 --- a/pandas/io/sql.py +++ b/pandas/io/sql.py @@ -361,11 +361,9 @@ def read_sql( or DBAPI2 connection (fallback mode) Using SQLAlchemy makes it possible to use any DB supported by that - library. If a DBAPI2 object, only sqlite3 is supported. - - Closing the connection is handled by the SQLAlchemy Engine. See `here \ - `_ - + library. If a DBAPI2 object, only sqlite3 is supported. The user is responsible + for engine disposal and connection closure for the SQLAlchemy connectable. See + `here `_ index_col : string or list of strings, optional, default: None Column(s) to set as index(MultiIndex). coerce_float : boolean, default True From 1f05feba5bbc7683083956322d752f7bd2e942b2 Mon Sep 17 00:00:00 2001 From: Mike Date: Wed, 6 Nov 2019 20:05:33 +0000 Subject: [PATCH 3/3] fix pep8 --- pandas/core/generic.py | 2 +- pandas/io/sql.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 6272ffae342c8..cfbd125b7445e 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -2645,7 +2645,7 @@ def to_sql( Name of SQL table. con : sqlalchemy.engine.Engine or sqlite3.Connection Using SQLAlchemy makes it possible to use any DB supported by that - library. Legacy support is provided for sqlite3.Connection objects. The user + library. Legacy support is provided for sqlite3.Connection objects. The user is responsible for engine disposal and connection closure for the SQLAlchemy connectable See `here \ `_ diff --git a/pandas/io/sql.py b/pandas/io/sql.py index 2eed02c62422c..684e602f06d12 100644 --- a/pandas/io/sql.py +++ b/pandas/io/sql.py @@ -361,9 +361,9 @@ def read_sql( or DBAPI2 connection (fallback mode) Using SQLAlchemy makes it possible to use any DB supported by that - library. If a DBAPI2 object, only sqlite3 is supported. The user is responsible - for engine disposal and connection closure for the SQLAlchemy connectable. See - `here `_ + library. If a DBAPI2 object, only sqlite3 is supported. The user is responsible + for engine disposal and connection closure for the SQLAlchemy connectable. See + `here `_ index_col : string or list of strings, optional, default: None Column(s) to set as index(MultiIndex). coerce_float : boolean, default True