Skip to content
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

Added Engine Disposal Documentation #27972

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion doc/source/whatsnew/v0.25.1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ I/O

- Avoid calling ``S3File.s3`` when reading parquet, as this was removed in s3fs version 0.3.0 (:issue:`27756`)
- Better error message when a negative header is passed in :func:`pandas.read_csv` (:issue:`27779`)
- Follow the ``min_rows`` display option (introduced in v0.25.0) correctly in the HTML repr in the notebook (:issue:`27991`).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you revert this file


Plotting
^^^^^^^^
Expand Down
39 changes: 25 additions & 14 deletions pandas/io/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,14 @@ def execute(sql, con, cur=None, params=None):
----------
sql : string
SQL query to be executed.
con : SQLAlchemy connectable(engine/connection) or sqlite3 connection
Using SQLAlchemy makes it possible to use any DB supported by the
library.
If a DBAPI2 object, only sqlite3 is supported.
con : SQLAlchemy connectable (engine/connection) or database string URI
or DBAPI2 connection (fallback mode)
Using SQLAlchemy makes it possible to use any DB supported by that
library. Legacy support is provided for sqlite3.Connection objects.

Note: The user is responsible for engine disposal and connection
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Note: The user is responsible for engine disposal and connection
Note: The user is responsible for engine disposal and connection

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For these "Note:" sections, let's add a newline above (this applies to your other changes)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey I added the newline however its not rendering in the documentation generated.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think they end up in the same paragraph in the generated HTML.

closure for the SQLAlchemy connectable. See `EngineDisposal
<https://docs.sqlalchemy.org/en/13/core/connections.html?highlight=engine#engine-disposal>`_.
cur : deprecated, cursor is obtained from connection, default: None
params : list or tuple, optional, default: None
List of parameters to pass to execute method.
Expand Down Expand Up @@ -187,6 +191,10 @@ def read_sql_table(
con : SQLAlchemy connectable or str
A database URI could be provided as as str.
SQLite DBAPI connection mode not supported.

Note: The user is responsible for engine disposal and connection
closure for the SQLAlchemy connectable. See `EngineDisposal
<https://docs.sqlalchemy.org/en/13/core/connections.html?highlight=engine#engine-disposal>`_.
schema : str, default None
Name of SQL schema in database to query (if database flavor
supports this). Uses default schema if None (default).
Expand Down Expand Up @@ -280,11 +288,15 @@ def read_sql_query(
----------
sql : string SQL query or SQLAlchemy Selectable (select or text object)
SQL query to be executed.
con : SQLAlchemy connectable(engine/connection), database string URI,
con : SQLAlchemy connectable(engine/connection) or database string URI
poojahagawane marked this conversation as resolved.
Show resolved Hide resolved
or sqlite3 DBAPI2 connection
Using SQLAlchemy makes it possible to use any DB supported by that
library.
If a DBAPI2 object, only sqlite3 is supported.
Using SQLAlchemy makes it possible to use any DB supported by
that library. Legacy support is provided for sqlite3.Connection
objects.

Note: The user is responsible for engine disposal and connection
closure for the SQLAlchemy connectable. See `EngineDisposal
<https://docs.sqlalchemy.org/en/13/core/connections.html?highlight=engine#engine-disposal>`_.
index_col : string or list of strings, optional, default: None
Column(s) to set as index(MultiIndex).
coerce_float : boolean, default True
Expand Down Expand Up @@ -360,9 +372,12 @@ def read_sql(
SQL query to be executed or a table name.
con : SQLAlchemy connectable (engine/connection) or database string URI
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.
library. Legacy support is provided for sqlite3.Connection objects.

Note: The user is responsible for engine disposal and connection
closure for the SQLAlchemy connectable. See `EngineDisposal
<https://docs.sqlalchemy.org/en/13/core/connections.html?highlight=engine#engine-disposal>`_.
index_col : string or list of strings, optional, default: None
Column(s) to set as index(MultiIndex).
coerce_float : boolean, default True
Expand Down Expand Up @@ -460,10 +475,6 @@ def to_sql(
Name of SQL table.
con : SQLAlchemy connectable(engine/connection) or database string URI
or sqlite3 DBAPI2 connection
Using SQLAlchemy makes it possible to use any DB supported by that
library.
If a DBAPI2 object, only sqlite3 is supported.
schema : str, optional
Name of SQL schema in database to write to (if database flavor
supports this). If None, use default schema (default).
if_exists : {'fail', 'replace', 'append'}, default 'fail'
Expand Down