Skip to content

Commit 62d0f3e

Browse files
committed
Fix "unused" BaseType import
1 parent 22100e3 commit 62d0f3e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

json_to_models/dynamic_typing/models_meta.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def add_child_ref(self, ptr: 'ModelPtr'):
9595
def remove_child_ref(self, ptr: 'ModelPtr'):
9696
self.child_pointers.remove(ptr)
9797

98-
def to_typing_code(self, types_style: Dict[Union['BaseType', Type['BaseType']], dict]) \
98+
def to_typing_code(self, types_style: Dict[Union[BaseType, Type[BaseType]], dict]) \
9999
-> Tuple[ImportPathList, str]:
100100
if self.name is None:
101101
raise ValueError('Model without name can not be typed')
@@ -132,7 +132,7 @@ def replace_parent(self, t: ModelMeta, **kwargs) -> 'ModelPtr':
132132
self.parent.add_child_ref(self)
133133
return self
134134

135-
def to_typing_code(self, types_style: Dict[Union['BaseType', Type['BaseType']], dict]) \
135+
def to_typing_code(self, types_style: Dict[Union[BaseType, Type[BaseType]], dict]) \
136136
-> Tuple[ImportPathList, str]:
137137
return AbsoluteModelRef(self.type).to_typing_code(types_style)
138138

@@ -190,7 +190,7 @@ def inject(cls, patches: ContextInjectionType):
190190
def __init__(self, model: ModelMeta):
191191
self.model = model
192192

193-
def to_typing_code(self, types_style: Dict[Union['BaseType', Type['BaseType']], dict]) \
193+
def to_typing_code(self, types_style: Dict[Union[BaseType, Type[BaseType]], dict]) \
194194
-> Tuple[ImportPathList, str]:
195195
context_data = self.Context.data.context
196196
if context_data:

json_to_models/dynamic_typing/typing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from .string_serializable import StringSerializable
88

99

10-
def metadata_to_typing(t: MetaData, types_style: Dict[Union['BaseType', Type['BaseType']], dict] = None) \
10+
def metadata_to_typing(t: MetaData, types_style: Dict[Union[BaseType, Type[BaseType]], dict] = None) \
1111
-> Tuple[ImportPathList, str]:
1212
"""
1313
Shortcut function to call ``to_typing_code`` method of BaseType instances or return name of type otherwise

0 commit comments

Comments
 (0)