Skip to content

Commit

Permalink
add doc strings
Browse files Browse the repository at this point in the history
  • Loading branch information
uzhastik committed Mar 10, 2024
1 parent 7efc741 commit 2bd6831
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions airflow/providers/yandex/yq_client/http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,15 @@ def __init__(self, config: YQHttpClientConfig):
self.session = _requests_retry_session(session=requests.Session())

def __enter__(self):
"""Return the object when a context manager is created."""
return self

def __exit__(self, *args):
"""Close network connection when exiting the context manager."""
self.session.close()

def close(self):
"""Close network connection."""
self.session.close()

def _build_headers(self, idempotency_key=None, request_id=None) -> dict[str, str]:
Expand Down

0 comments on commit 2bd6831

Please sign in to comment.