betodealmeida commented on code in PR #36034:
URL: https://github.com/apache/superset/pull/36034#discussion_r2519804421


##########
superset/connectors/sqla/models.py:
##########
@@ -1912,7 +1921,11 @@ class and any keys added via `ExtraCache`.
         """
         extra_cache_keys = super().get_extra_cache_keys(query_obj)
         if self.has_extra_cache_key_calls(query_obj):
-            sqla_query = self.get_sqla_query(**query_obj)
+            # Filter out keys that aren't parameters to get_sqla_query
+            filtered_query_obj = {
+                k: v for k, v in query_obj.items() if k in SQLA_QUERY_KEYS
+            }
+            sqla_query = self.get_sqla_query(**cast(Any, filtered_query_obj))

Review Comment:
   Right, if someone adds a new parameter to `get_sqla_query` but forgets to 
add it to `SQLA_QUERY_KEYS` then it won't be passed. I assume they would catch 
the error when testing their changes, because otherwise their changes will be 
no-op.



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