Skip to content

Commit

Permalink
Fix is None pre-commit check
Browse files Browse the repository at this point in the history
  • Loading branch information
ConnorStoneAstro committed Aug 7, 2024
1 parent d4eff65 commit 9d568e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/caustics/models/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def _init_kwargs_field_check(cls, v, info: ValidationInfo):
field_name = info.field_name
field = cls.model_fields[field_name]
anno_args = typing.get_args(field.annotation)
if len(anno_args) == 2 and anno_args[1] == type(None):
if len(anno_args) == 2 and anno_args[1] is None:
# This means that the anno is optional
expected_type = next(
filter(lambda x: x is not None, typing.get_args(field.annotation))
Expand Down

0 comments on commit 9d568e8

Please sign in to comment.