You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "michael-s-molina (via GitHub)" <gi...@apache.org> on 2024/07/02 17:01:44 UTC
Re: [PR] chore(dao/command): Add transaction decorator to try to enforce "unit of work" [superset]
michael-s-molina commented on code in PR #24969:
URL: https://github.com/apache/superset/pull/24969#discussion_r1657070057
##########
superset/commands/database/update.py:
##########
@@ -77,19 +78,13 @@ def run(self) -> Model:
original_database_name = self._model.database_name
try:
- database = DatabaseDAO.update(
- self._model,
- self._properties,
- commit=False,
- )
+ database = DatabaseDAO.update(self._model, self._properties)
database.set_sqlalchemy_uri(database.sqlalchemy_uri)
ssh_tunnel = self._handle_ssh_tunnel(database)
self._refresh_catalogs(database, original_database_name, ssh_tunnel)
except SSHTunnelError: # pylint: disable=try-except-raise
Review Comment:
I believe in this case you don't need the `try/catch` as there's no event logging or anything in the `catch` block.
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org