sadpandajoe commented on code in PR #44406:
URL: https://github.com/apache/superset/pull/44406#discussion_r4290176618
##########
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:
Annotation fetches can now lose their incomplete-result signal:
`SemanticResultCompletenessError` subclasses `QueryObjectValidationError`, so
when the dataframe succeeds but a semantic-view annotation raises it here, this
catch turns it into a failed payload instead of letting it propagate as the
dataframe path above does (and as the old combined block did).
`execute_chart_query` then returns normally and the async task is marked
successful without publishing `semantic_result_error`. Should this re-raise
`SemanticResultCompletenessError` before the generic catch, with a
`get_df_payload_result` test asserting an annotation-side completeness error
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]