diff --git a/pyhive/presto.py b/pyhive/presto.py index a38cd891..8a4e798c 100644 --- a/pyhive/presto.py +++ b/pyhive/presto.py @@ -64,6 +64,13 @@ def __init__(self, *args, **kwargs): self._args = args self._kwargs = kwargs + def __enter__(self): + return self + + def __exit__(self): + """Call close""" + self.close() + def close(self): """Presto does not have anything to close""" # TODO cancel outstanding queries?