From 8d249e88ac7270f5170c357d6e9283b87854cd09 Mon Sep 17 00:00:00 2001 From: Thomas Dickson Date: Mon, 28 Jun 2021 08:19:21 +0000 Subject: [PATCH] DOC GH29075 specify requirement to close database connections after creation --- doc/source/user_guide/io.rst | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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 ''''''''''''''''''