codeant-ai-for-open-source[bot] commented on code in PR #45895:
URL: https://github.com/apache/superset/pull/45895#discussion_r4440104581


##########
superset/semantic_layers/models.py:
##########
@@ -905,6 +905,23 @@ def get_extra_cache_keys(self, query_obj: QueryObjectDict) 
-> list[Hashable]:
         keys: list[Hashable] = [self.metadata_generation, 
"semantic-null-filters-v1"]
         if discriminator is not None:
             keys.append(("semantic-result-version", *discriminator))
+
+        from superset import is_feature_enabled
+
+        if is_feature_enabled("CACHE_QUERY_BY_USER"):
+            try:
+                from superset.semantic_layers.execution import (
+                    current_host_execution_context,
+                )
+
+                exec_context = current_host_execution_context()
+                if not exec_context.is_guest and exec_context.identity_digest:
+                    keys.append(("semantic-user", 
exec_context.identity_digest))
+            except Exception as ex:
+                logger.debug(
+                    "Could not resolve semantic execution context for cache: 
%s", ex
+                )

Review Comment:
   ✅ **CodeAnt verified this suggestion was addressed in subsequent commits and 
marked this thread resolved** as of `d43e6e3`.
   
   When execution-context resolution raises an exception, the cache keys now 
include a fresh `semantic-user-unresolved` UUID, preventing reuse of results 
from another context.
   
   <sub>If that's not right, unresolve this thread and CodeAnt will leave it 
open.</sub>
   
   <!-- codeant-auto-resolve-reply -->



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

  • Re: [PR] fi... via GitHub
  • Re: [PR] fi... codeant-ai-for-open-source[bot] (via GitHub) via notifications
  • Re: [PR] fi... FrancescoCastaldi (via GitHub) via notifications
  • Re: [PR] fi... netlify[bot] (via GitHub) via notifications
  • Re: [PR] fi... FrancescoCastaldi (via GitHub) via notifications
  • Re: [PR] fi... FrancescoCastaldi (via GitHub) via notifications
  • Re: [PR] fi... FrancescoCastaldi (via GitHub) via notifications
  • Re: [PR] fi... codeant-ai-for-open-source[bot] (via GitHub) via notifications
  • Re: [PR] fi... codeant-ai-for-open-source[bot] (via GitHub) via notifications
  • Re: [PR] fi... EnxDev (via GitHub) via notifications
  • Re: [PR] fi... codeant-ai-for-open-source[bot] (via GitHub) via notifications

Reply via email to