rusackas commented on code in PR #44406:
URL: https://github.com/apache/superset/pull/44406#discussion_r4297990070
##########
superset/common/query_context_processor.py:
##########
@@ -354,6 +359,30 @@ 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 query_obj.annotation_layers
+ and cache.status != QueryStatus.FAILED
+ ):
+ try:
+ annotation_data = self._get_annotation_data_cached(
+ query_obj=query_obj,
+ cache_key=annotation_key,
+ force_query=annotation_force_query,
+ force_cached=force_cached,
+ timeout=self.get_cache_timeout(),
+ datasource_uid=self._qc_datasource.uid,
+ )
+ except QueryObjectValidationError as ex:
Review Comment:
Good catch. The annotation catch now re-raises
`SemanticResultCompletenessError` before the generic
`QueryObjectValidationError` handler, same as the dataframe path. Added a
`get_df_payload_result` test asserting it escapes.
--
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]