betodealmeida commented on code in PR #37315:
URL: https://github.com/apache/superset/pull/37315#discussion_r2714423988
##########
superset/models/core.py:
##########
@@ -896,6 +896,9 @@ def get_all_table_names_in_schema(
)
}
except Exception as ex:
+ if self.is_oauth2_enabled() and
self.db_engine_spec.needs_oauth2(ex):
+ self.start_oauth2_dance()
Review Comment:
This pattern is common enough that maybe we should have a method `def
try_oauth2`? (not in this PR)
```python
def try_oauth2(self):
if self.is_oauth2_enabled() and self.db_engine_spec.needs_oauth2(ex):
self.start_oauth2_dance()
```
Then:
```python
except Exception as ex:
self.try_oauth2()
raise self.db_engine_spec.get_dbapi_mapped_exception(ex) from ex
```
--
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]