PyHive icon indicating copy to clipboard operation
PyHive copied to clipboard

Add is_open to check transport of connection

Open sihyeonn opened this issue 2 years ago • 2 comments

To check whether the transport of connection is open or not, It would be great is_open method exists. Checking the connection first is helpful to prevent BrokenPIpeError from occuring and gives a chance to build a new connection.

AS-IS:

connection = hive.connect(host=_HOST)
print(connection._transport.isOpen())

TO-BE:

connection = hive.connect(host=_HOST)
print(connection.is_open())

sihyeonn avatar Dec 06 '23 11:12 sihyeonn

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Dec 06 '23 11:12 CLAassistant

@mdeshmu , this one is ready for CI and review. Thanks

sihyeonn avatar Dec 12 '23 10:12 sihyeonn