Open yambottle opened 1 year ago
Datajoint connection cannot be defined with the python with, and using with is the regular way to make sure a connection is closed after dj.conn().
with
dj.conn()
Include:
with dj.conn(**conn_info) as connection: print(connection)
Traceback (most recent call last): File , in <module> app.lambda_handler(payload.EVENT, payload.CONTEXT) File , line 136, in lambda_handler with dj.conn(**conn_info): AttributeError: __enter__
Using with to create a datajoint db connection, and close the connection at the end of the with clause.
AFAIK, dj.Connection does not implement a context manager. So this issue is a feature request to add context manager functionality to dj.Connection, not a bug fix.
dj.Connection
Bug Report
Description
Datajoint connection cannot be defined with the python
with
, and usingwith
is the regular way to make sure a connection is closed afterdj.conn()
.Reproducibility
Include:
Expected Behavior
Using
with
to create a datajoint db connection, and close the connection at the end of thewith
clause.