We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7058811 commit 9a85e4dCopy full SHA for 9a85e4d
src/betterproto/plugin/models.py
@@ -440,15 +440,14 @@ def betterproto_field_args(self) -> List[str]:
440
441
@property
442
def datetime_imports(self) -> Set[str]:
443
- # imports = set()
444
- # annotation = self.annotation
445
- # # FIXME: false positives - e.g. `MyDatetimedelta`
446
- # if "timedelta" in annotation:
447
- # imports.add("timedelta")
448
- # if "datetime" in annotation:
449
- # imports.add("datetime")
450
- # return imports
451
- return {"timedelta", "datetime"}
+ imports = set()
+ annotation = self.annotation
+ # FIXME: false positives - e.g. `MyDatetimedelta`
+ if "timedelta" in annotation:
+ imports.add("timedelta")
+ if "datetime" in annotation:
+ imports.add("datetime")
+ return imports
452
453
454
def pydantic_imports(self) -> Set[str]:
0 commit comments