PyHive icon indicating copy to clipboard operation
PyHive copied to clipboard

Add __enter__, __exit__ methods

Open gglanzani opened this issue 7 years ago • 4 comments

The methods allow us to use connections and cursors with withs statements.

gglanzani avatar May 31 '18 08:05 gglanzani

Pinging @jingw directly, hoping for a faster merge :)

gglanzani avatar May 31 '18 09:05 gglanzani

@gglanzani can this be added also to the presto part? This client seems to have it implemented: https://github.com/prestodb/presto-python-client/blob/master/prestodb/dbapi.py#L121

I've added #218 in a similar spirit to this PR. Seems to work (at lest with connection object) but it needs review.

petobens avatar Jun 08 '18 20:06 petobens

@petobens sure, it should just work, but I don't have a presto cluster to test it :)

gglanzani avatar Jun 08 '18 20:06 gglanzani

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Apr 16 '22 21:04 CLAassistant