sadpandajoe commented on code in PR #44406:
URL: https://github.com/apache/superset/pull/44406#discussion_r4075812948


##########
superset/common/query_context_processor.py:
##########
@@ -328,6 +327,26 @@ def get_df_payload_result(
                 # nonce reads the freshly-cached result instead of recomputing 
it.
                 self._mark_force_executed(query_obj, cache_key, 
cache.result_persisted)
 
+        # Annotation data is fetched per requesting user (and, for chart-backed
+        # layers, scoped by the referenced chart datasource's RLS), so it is
+        # resolved and cached under its own entry — independent of whether the
+        # (shareable) dataframe above was a hit or a miss — rather than forcing
+        # every viewer of the same chart onto their own full dataframe copy.
+        annotation_data: dict[str, Any] = {}
+        if query_obj and annotation_key and cache.status != QueryStatus.FAILED:
+            try:
+                annotation_data = self._get_annotation_data_cached(
+                    query_obj=query_obj,
+                    cache_key=annotation_key,
+                    force_query=force_query,

Review Comment:
   A forced refresh can still serve stale annotations for a second access 
scope: once the shared dataframe marker suppresses `force_query`, this reads 
that scope's existing annotation entry instead of refreshing it. Should the 
annotation cache have its own force/nonce state so each scoped entry is 
refreshed?



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