Skip to content
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

chore: always get dashboard_id on dashboard API get endpoint #20894

Merged
merged 6 commits into from
Aug 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions superset/dashboards/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,13 +285,14 @@ def __repr__(self) -> str:
@protect()
@safe
@statsd_metrics
@event_logger.log_this_with_context(
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.get",
log_to_statsd=False,
)
@with_dashboard
# pylint: disable=arguments-renamed, arguments-differ
def get(self, dash: Dashboard) -> Response:
@event_logger.log_this_with_extra_payload
# pylint: disable=arguments-differ
def get(
self,
dash: Dashboard,
add_extra_log_payload: Callable[..., None] = lambda **kwargs: None,
) -> Response:
"""Gets a dashboard
---
get:
Expand Down Expand Up @@ -323,6 +324,9 @@ def get(self, dash: Dashboard) -> Response:
$ref: '#/components/responses/404'
"""
result = self.dashboard_get_response_schema.dump(dash)
add_extra_log_payload(
dashboard_id=dash.id, action=f"{self.__class__.__name__}.get"
)
return self.response(200, result=result)

@etag_cache(
Expand Down