ktmud commented on a change in pull request #10963:
URL:
https://github.com/apache/incubator-superset/pull/10963#discussion_r496313536
##########
File path: superset/utils/decorators.py
##########
@@ -46,7 +46,12 @@ def stats_timing(stats_key: str, stats_logger:
BaseStatsLogger) -> Iterator[floa
stats_logger.timing(stats_key, now_as_float() - start_ts)
-def etag_cache(max_age: int, check_perms: Callable[..., Any]) -> Callable[...,
Any]:
+def etag_cache(
+ max_age: int,
+ check_perms: Callable[..., Any],
+ get_latest_changed_on: Optional[Callable[..., Any]] = None,
Review comment:
Can we rename `get_latest_changed_on` to `get_last_modified` just to be
more consistent with the response attribute? Imagine in future refactor
`response.last_modified` is renamed to something else, you would know this
function is definitely related by searching for `last_modified`.
##########
File path: superset/views/core.py
##########
@@ -1585,49 +1598,32 @@ def publish( # pylint: disable=no-self-use
return json_success(json.dumps({"published": dash.published}))
@has_access
+ @etag_cache(
+ 0,
+ check_perms=check_dashboard_perms,
+ get_latest_changed_on=get_dashboard_changedon_dt,
Review comment:
Nit: it's a little weird to have both `changed_on` and `changedon`.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]