You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/06/16 17:54:24 UTC

[GitHub] [incubator-superset] villebro commented on a change in pull request #10070: fix: use custom int parsing over flask int parsing in sqllab queries endpoint

villebro commented on a change in pull request #10070:
URL: https://github.com/apache/incubator-superset/pull/10070#discussion_r441036437



##########
File path: superset/views/core.py
##########
@@ -2658,14 +2658,15 @@ def fetch_datasource_metadata(self) -> FlaskResponse:
         return json_success(json.dumps(datasource.data))
 
     @has_access_api
-    @expose("/queries/<int:last_updated_ms>")
-    def queries(self, last_updated_ms: int) -> FlaskResponse:
+    @expose("/queries/<last_updated_ms>")
+    def queries(self, last_updated_ms: str) -> FlaskResponse:
         """
         Get the updated queries.
 
         :param last_updated_ms: unix time, milliseconds
         """
-        return self.queries_exec(last_updated_ms)
+        last_updated_ms_int = int(float(last_updated_ms)) if last_updated_ms else 0

Review comment:
       I wonder if there's a cleaner way of doing `int(float(x))`




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org