You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation notes that if the con is a SQLAlchemy connectable that the user is responsible for disposing/closing. The documentation doesn't note whether the connection is closed if the user provides a str to the con parameter. In my quick search, I couldn't find a reference to .dispose()/.close() in the source code when the user provides a str type con. Is this connection being closed? Is it being left up to garbage collection as noted in SQLAlchemy docs?
Suggested fix for documentation
I think a note about connection closure for str type cons would be a nice addition. Right now, if I'm understanding correctly, the connection is being garbage collected and the user needs to infer from the docs that they don't need to worry about an open connection.
Current wording:
The user is responsible for engine disposal and connection closure for the SQLAlchemy connectable.
Potential wording:
The user is responsible for engine disposal and connection closure for the SQLAlchemy connectable; str connections are closed automatically.
The text was updated successfully, but these errors were encountered:
and scrolling down the SQLAlchemydoc page you linked, at the bottom of theConnectionless Execution, Implicit Execution section:
the Connection is created behind the scenes; the CursorResult returned by the execute() call references the Connection
used to issue the SQL statement. When the CursorResult is closed, the underlying Connection is closed for us,
resulting in the DBAPI connection being returned to the pool with transactional resources removed.
A pull request with the clarification you propose will be welcome!
This is in between a documentation issue and a general question.
Location of the documentation
pd.read_sql()
Documentation problem
The documentation notes that if the
con
is aSQLAlchemy connectable
that the user is responsible for disposing/closing. The documentation doesn't note whether the connection is closed if the user provides astr
to thecon
parameter. In my quick search, I couldn't find a reference to.dispose()
/.close()
in the source code when the user provides astr
typecon
. Is this connection being closed? Is it being left up to garbage collection as noted in SQLAlchemy docs?Suggested fix for documentation
I think a note about connection closure for
str
typecon
s would be a nice addition. Right now, if I'm understanding correctly, the connection is being garbage collected and the user needs to infer from the docs that they don't need to worry about an open connection.Current wording:
Potential wording:
The text was updated successfully, but these errors were encountered: