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/05/27 03:34:44 UTC

[GitHub] [incubator-superset] villebro commented on a change in pull request #9905: style(mypy): Enforcing typing for superset.utils

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



##########
File path: superset/utils/cache.py
##########
@@ -14,14 +14,14 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-from typing import Callable, Optional
+from typing import Any, Callable, Optional
 
 from flask import request
 
 from superset.extensions import cache_manager
 
 
-def view_cache_key(*_, **__) -> str:
+def view_cache_key(*args: Any, **kwargs: Any) -> str:  # pylint: disable=unused-argument

Review comment:
       I personally prefer `*_: Any, **__: Any` if it allows us to avoid disabling linting for a row.

##########
File path: superset/utils/core.py
##########
@@ -397,7 +403,7 @@ def base_json_conv(obj):
             return "[bytes]"
 
 
-def json_iso_dttm_ser(obj, pessimistic: Optional[bool] = False):
+def json_iso_dttm_ser(obj: Any, pessimistic: Optional[bool] = False) -> str:

Review comment:
       Does `pessimistic` need to be `Optional` if it defaults to `False`?

##########
File path: superset/utils/core.py
##########
@@ -1119,7 +1142,7 @@ def add_ago_to_since(since: str) -> str:
     return since
 
 
-def convert_legacy_filters_into_adhoc(fd):
+def convert_legacy_filters_into_adhoc(fd: Dict[str, Any]) -> None:

Review comment:
       Did we have a `FormData` alias? If not perhaps we should introduce one.




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