rusackas commented on code in PR #37516:
URL: https://github.com/apache/superset/pull/37516#discussion_r3656236502


##########
superset/common/utils/query_cache_manager.py:
##########
@@ -116,13 +166,17 @@ def set_query_result(
             self.queried_dttm = (
                 
datetime.now(tz=timezone.utc).replace(microsecond=0).isoformat()
             )
+            self.source_trace = query_result.source_trace
 
             if self.status != QueryStatus.FAILED:
-                current_app.config["STATS_LOGGER"].incr("loaded_from_source")
-                if not force_query:
-                    current_app.config["STATS_LOGGER"].incr(
-                        "loaded_from_source_without_force"
-                    )
+                try:
+                    
current_app.config["STATS_LOGGER"].incr("loaded_from_source")
+                    if not force_query:
+                        current_app.config["STATS_LOGGER"].incr(
+                            "loaded_from_source_without_force"
+                        )
+                except Exception:  # pylint: disable=broad-except
+                    logger.exception("Unable to emit source load metric")
                 self.is_loaded = True

Review Comment:
   `is_cached` staying `None` instead of `False` on a fresh load isn't new 
here, `get()` on `master` already only sets `is_cached` on a cache hit and 
never flips it to `False` on a miss. Not something this diff changed.



##########
superset/commands/chart/warm_up_cache.py:
##########
@@ -40,10 +45,10 @@
 class ChartWarmUpCacheCommand(BaseCommand):
     def __init__(
         self,
-        chart_or_id: Union[int, Slice],
-        dashboard_id: Optional[int],
-        extra_filters: Optional[str],
-    ):
+        chart_or_id: int | Slice,
+        dashboard_id: int | None,
+        extra_filters: str | None,
+    ) -> None:

Review Comment:
   Checked every call site, `views/core.py`, `charts/api.py`, 
`commands/dataset/warm_up_cache.py`, and the tests, they all already pass 
chart, dashboard_id, and extra_filters. I don't see a one-arg 
`ChartWarmUpCacheCommand(chart_id)` call anywhere, so I think this line 
reference is off.



-- 
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]

Reply via email to