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_r319206814
 
 

 ##########
 File path: superset/common/query_context.py
 ##########
 @@ -40,8 +42,13 @@ class QueryContext:
     to retrieve the data payload for a given viz.
     """
 
-    cache_type = "df"
-    enforce_numerical_metrics = True
+    cache_type: str = "df"
+    enforce_numerical_metrics: bool = True
+
+    datasource: BaseDatasource
+    queries: List[QueryObject]
+    force: bool
+    custom_cache_timeout: Optional[int]
 
 Review comment:
   In this case it's fine because I don't actually set a value for queries, so 
these are just here to enforce types so that statements like 
`a.queries.append(3)` will fail. The problem you described would happen if I 
had written something like `queries: List[QueryObject] = []`.
   
   ...which I just realized I probably did in other files. Thanks for alerting 
me about this issue!

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


With regards,
Apache Git Services

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

Reply via email to