diff --git a/doc/source/user_guide/io.rst b/doc/source/user_guide/io.rst index c2b030d732ba9..1b28aa2900f65 100644 --- a/doc/source/user_guide/io.rst +++ b/doc/source/user_guide/io.rst @@ -5526,13 +5526,23 @@ below and the SQLAlchemy `documentation `__ +for an explanation of how the database connection is handled. .. code-block:: python with engine.connect() as conn, conn.begin(): data = pd.read_sql_table("data", conn) +.. warning:: + + When you open a connection to a database you are also responsible for closing it. + Side effects of leaving a connection open may include locking the database or + other breaking behaviour. + Writing DataFrames ''''''''''''''''''