kbohra commented on code in PR #62919:
URL: https://github.com/apache/airflow/pull/62919#discussion_r2890478184
##########
providers/fab/src/airflow/providers/fab/auth_manager/fab_auth_manager.py:
##########
@@ -292,16 +292,26 @@ def session(self):
@cachedmethod(lambda self: self.cache, key=lambda _, token:
int(token["sub"]))
def deserialize_user(self, token: dict[str, Any]) -> User:
+ user_id = int(token["sub"])
try:
- return self.session.scalars(select(User).where(User.id ==
int(token["sub"]))).one()
+ return self.session.scalars(select(User).where(User.id ==
user_id)).one()
except NoResultFound:
raise ValueError(f"User with id {token['sub']} not found")
except SQLAlchemyError:
# Discard the poisoned scoped session so the next request gets a
# fresh connection from the pool instead of a PendingRollbackError.
with suppress(Exception):
self.session.remove()
- raise
+ try:
Review Comment:
sure @vincbeck
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]