bito-code-review[bot] commented on PR #44765:
URL: https://github.com/apache/superset/pull/44765#issuecomment-5865305903
<!-- Bito Reply -->
The flagged issue is correct. The current implementation of
`_open_with_oauth2_retry` only wraps the initial connection opening, meaning
subsequent metadata operations (like `inspector.get_columns()`) that occur
outside this context will not benefit from the retry logic if they encounter a
token rejection.
To resolve this, you should ensure that the retry logic encompasses the
entire scope of the database interaction, not just the initial connection. You
can achieve this by extending the `execute_with_oauth2_retry` wrapper to cover
the metadata calls as well, or by refactoring the calling code to use the
retry-enabled context manager for all operations that require a valid token.
I have checked the available PR comments, and there are no other comments to
address at this time. Would you like me to proceed with implementing a fix for
this issue?
**superset/models/core.py**
```
with ExitStack() as stack:
yield execute_with_oauth2_retry(
self,
lambda: stack.enter_context(open_context()),
)
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]