fix: oauth2 trino (#31993)

This commit is contained in:
Dmitry Kochnev
2025-02-21 02:04:11 +03:00
committed by GitHub
parent 42a3c523ae
commit 7ce1a3445c

View File

@@ -62,9 +62,7 @@ except ImportError:
class CustomTrinoAuthErrorMeta(type):
def __instancecheck__(cls, instance: object) -> bool:
logger.info("is this being called?")
return isinstance(
instance, HttpError
) and "error 401: b'Invalid credentials'" in str(instance)
return isinstance(instance, HttpError) and "error 401" in str(instance)
class TrinoAuthError(HttpError, metaclass=CustomTrinoAuthErrorMeta):