serenajiang commented on a change in pull request #8138: [typing] add typing 
for superset/connectors and superset/common
URL: 
https://github.com/apache/incubator-superset/pull/8138#discussion_r321472045
 
 

 ##########
 File path: superset/common/query_object.py
 ##########
 @@ -72,15 +89,15 @@ def __init__(
             for metric in metrics
         ]
         self.row_limit = row_limit
-        self.filter = filters if filters is not None else []
+        self.filter = filters or []
         self.timeseries_limit = timeseries_limit
         self.timeseries_limit_metric = timeseries_limit_metric
         self.order_desc = order_desc
-        self.extras = extras if extras is not None else {}
-        self.columns = columns if columns is not None else []
-        self.orderby = orderby if orderby is not None else []
+        self.extras = extras or {}
+        self.columns = columns or []
+        self.orderby = orderby or []
 
-    def to_dict(self):
+    def to_dict(self) -> Dict:
 
 Review comment:
   I kept `Dict` types pretty vague - partly because I wasn't always sure about 
what type the dict was and partly because most of the Dicts are `[str, Any]` 
anyways, so this isn't too useful anyways. Still, this example is pretty 
unambiguous, so I'll change some of the more obvious Dict types like this to be 
more explicit.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to