From 2d2143d195d4b0daf89fffa01a8c495e8051187d Mon Sep 17 00:00:00 2001 From: squak Date: Thu, 31 Mar 2022 22:13:12 +0300 Subject: [PATCH 1/2] fix: fix wrong typing for the AdvancedDjangoFilterConnectionField constructor --- graphene_django_filter/connection_field.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/graphene_django_filter/connection_field.py b/graphene_django_filter/connection_field.py index 8ead167..78b1454 100644 --- a/graphene_django_filter/connection_field.py +++ b/graphene_django_filter/connection_field.py @@ -4,7 +4,7 @@ module instead of the `DjangoFilterConnectionField` from graphene-django. """ -from typing import Any, Dict, Iterable, Optional, Type +from typing import Any, Callable, Dict, Iterable, Optional, Type, Union import graphene from django.core.exceptions import ValidationError @@ -24,7 +24,7 @@ class AdvancedDjangoFilterConnectionField(DjangoFilterConnectionField): def __init__( self, - type: Type[DjangoObjectType], + type: Union[Type[DjangoObjectType], Callable[[], Type[DjangoObjectType]], str], fields: Optional[Dict[str, list]] = None, order_by: Any = None, extra_filter_meta: Optional[dict] = None, From a4ee6231fd8e90e2c243c32d9eeba8ebcf4e5018 Mon Sep 17 00:00:00 2001 From: squak Date: Thu, 31 Mar 2022 22:14:45 +0300 Subject: [PATCH 2/2] chore: ignore dynamically typed expressions --- .flake8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.flake8 b/.flake8 index fec084b..8702165 100644 --- a/.flake8 +++ b/.flake8 @@ -6,7 +6,7 @@ per-file-ignores = test_filterset.py:N802 filters.py:A003 0001_initial.py:D100,D101,D104 -ignore = ANN002,ANN003,ANN101,ANN102,D106,D107 +ignore = ANN002,ANN003,ANN401,ANN101,ANN102,D106,D107 import-order-style = pycharm dictionaries=en_US,python,technical,django