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



##########
File path: superset/typing.py
##########
@@ -16,15 +16,31 @@
 # under the License.
 from typing import Any, Callable, Dict, List, Optional, Tuple, Union
 
-from flask import Flask
+import flask
+import werkzeug
 from flask_caching import Cache
 
-CacheConfig = Union[Callable[[Flask], Cache], Dict[str, Any]]
+CacheConfig = Union[Callable[[flask.Flask], Cache], Dict[str, Any]]
 DbapiDescriptionRow = Tuple[
     str, str, Optional[str], Optional[str], Optional[int], Optional[int], bool
 ]
 DbapiDescription = Union[List[DbapiDescriptionRow], Tuple[DbapiDescriptionRow, 
...]]
 DbapiResult = List[Union[List[Any], Tuple[Any, ...]]]
 FilterValue = Union[float, int, str]
 FilterValues = Union[FilterValue, List[FilterValue], Tuple[FilterValue]]
+Granularity = Union[str, Dict[str, Union[str, float]]]
+Metric = Union[Dict[str, str], str]
+QueryObjectDict = Dict[str, Any]
 VizData = Optional[Union[List[Any], Dict[Any, Any]]]
+
+# Flask response.
+Base = Union[bytes, str]
+Status = Union[int, str]
+Headers = Dict[str, Any]
+FlaskResponse = Union[
+    flask.wrappers.Response,
+    werkzeug.wrappers.Response,
+    Base,
+    Union[Base, Status],
+    Union[Base, Status, Headers],
+]

Review comment:
       Ok, that makes sense. Unrelated comment, it's really strange how 
practically none of the major libraries have implemented type annotations yet. 
Yes, stubs exist for many, but that doesn't really help when reading code.




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