villebro commented on a change in pull request #13331:
URL: https://github.com/apache/superset/pull/13331#discussion_r582638223



##########
File path: superset/common/query_object.py
##########
@@ -181,8 +181,10 @@ def __init__(
         self.order_desc = order_desc
         self.extras = extras
 
-        if config["SIP_15_ENABLED"] and "time_range_endpoints" not in 
self.extras:
-            self.extras["time_range_endpoints"] = 
get_time_range_endpoints(form_data={})
+        if config["SIP_15_ENABLED"]:
+            self.extras["time_range_endpoints"] = get_time_range_endpoints(
+                form_data=self.extras
+            )

Review comment:
       Oh wow, that would explain some of the problems people have been having 
with time range endpoints not working correctly. Passing `self.extras` as 
`form_data` feels slightly wrong; should we change the sig so that it's `def 
get_time_range_endpoints(extras: ExtraFormData)` or similar and perhaps add a 
`TypedDict` for it in `superset/utils/core.py` like here? 
https://github.com/apache/superset/blob/8ab45c90ccc04f51a0e7db12b622fb63a29ec27c/superset/utils/core.py#L175-L177




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

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