-
Notifications
You must be signed in to change notification settings - Fork 14.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ssh_tunnel): DAO Changes for SSH Tunnel #22120
feat(ssh_tunnel): DAO Changes for SSH Tunnel #22120
Conversation
- New DAO Class for SSH Tunnel - Add method to fetch related ssh tunnel in the DatabaseDAO
superset/databases/dao.py
Outdated
@@ -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_related_ssh_tunnel(cls, database_id: int) -> Dict[str, Any]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's just call the get_ssh_tunnel
since it's a 1 to 1 relationship
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! Renamed to get_ssh_tunnel
👍
- Rename method since it's a 1:1 relationship
@@ -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]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also can we write a small unit test for this here's an example
def test_datasource_find_by_id_skip_base_filter_not_found( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added :)
- Add Unit Tests for our new method in the DatabaseDAO
SUMMARY
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION