eschutho commented on code in PR #21912:
URL: https://github.com/apache/superset/pull/21912#discussion_r1026939362
##########
superset/databases/dao.py:
##########
@@ -124,3 +125,13 @@ def get_related_objects(cls, database_id: int) ->
Dict[str, Any]:
return dict(
charts=charts, dashboards=dashboards,
sqllab_tab_states=sqllab_tab_states
)
+
+ @classmethod
+ def get_ssh_tunnel(cls, database_id: int) -> Dict[str, Any]:
+ ssh_tunnel = (
+ db.session.query(SSHTunnel)
+ .filter(SSHTunnel.database_id == database_id)
+ .one_or_none()
+ )
+
+ return dict(ssh_tunnel=ssh_tunnel)
Review Comment:
why return a dictionary instead of the original model instance?
--
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]