Skip to content

Commit 5aca055

Browse files
committed
Imports typing during conversion of struct code to Dict
1 parent 6f626ea commit 5aca055

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

protobuf_to_pydantic/plugin/field_desc_proto_to_code.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,7 @@ def _get_type_factory(module_name: str, message_name: str) -> Any:
623623
py_type_str = "typing.Dict"
624624
rule_type_str = "struct"
625625
type_factory = dict
626+
self._add_import_code("typing")
626627
elif field.type_name.startswith(".google.protobuf"):
627628
py_type_str = _type_str
628629
rule_type_str = "any"

0 commit comments

Comments
 (0)