This removes cls.connections.pop(conn.name), else it will have a key error when attempting to pop an invalid key from the dictionary of connections. This line isn't necessary from what I can see. Perhaps someone else with a different use case may need this can chime in after testing.
@classmethod
, elsesql.connection.Connection._close(args.close)
from https://github.com/catherinedevlin/ipython-sql/blob/12f9742a0a4eded514cc95377c920330ccba5e72/src/sql/magic.py#L166 will get an error saying that descriptor argument is required.@classmethod
will allowself
to be passed through, andargs.close
will correctly pass as an argument fordescriptor
.descriptor
is a connection string.cls.connections.pop(conn.name)
, else it will have a key error when attempting to pop an invalid key from the dictionary of connections. This line isn't necessary from what I can see. Perhaps someone else with a different use case may need this can chime in after testing.