Compatibility shims for third-party libraries used by TigerGraph connection.
patch_requests_exceptions()
Monkey-patch requests exception classes to add add_note() if missing.
Source code in graflo/db/tigergraph/compat.py
| def patch_requests_exceptions() -> None:
"""Monkey-patch requests exception classes to add add_note() if missing."""
try:
from requests.exceptions import (
ConnectionError,
HTTPError,
RequestException,
Timeout,
)
_patch_exception_class(HTTPError)
_patch_exception_class(ConnectionError)
_patch_exception_class(Timeout)
_patch_exception_class(RequestException)
except (ImportError, AttributeError):
pass
|