Skip to content

Commit d81618a

Browse files
committed
WIP
1 parent 2d39e7f commit d81618a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

superset/common/query_object.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,17 @@ def cache_key(self, **extra: Any) -> str: # noqa: C901
436436
if self.time_range:
437437
cache_dict["time_range"] = self.time_range
438438
if self.post_processing:
439-
cache_dict["post_processing"] = self.post_processing
439+
# Exclude contribution_totals from post_processing as it's computed at
440+
# runtime and varies per request, which would cause cache key mismatches
441+
post_processing_for_cache = []
442+
for pp in self.post_processing:
443+
pp_copy = dict(pp)
444+
if pp_copy.get("operation") == "contribution" and "options" in pp_copy:
445+
options = dict(pp_copy["options"])
446+
options.pop("contribution_totals", None)
447+
pp_copy["options"] = options
448+
post_processing_for_cache.append(pp_copy)
449+
cache_dict["post_processing"] = post_processing_for_cache
440450
if self.time_offsets:
441451
cache_dict["time_offsets"] = self.time_offsets
442452

0 commit comments

Comments
 (0)