We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8f8b6e1 commit 7608d03Copy full SHA for 7608d03
1 file changed
src/osw/model/entity.py
@@ -46,6 +46,7 @@ def cast_none_to_default(self, cls: Type[T]) -> T:
46
"""Casting self into target class. If the passed attribute is None or solely
47
includes None values, the attribute is not passed to the instance of the
48
target class, which will then fall back to the default."""
49
+
50
def test_if_empty_list_or_none(obj) -> bool:
51
if obj is None:
52
return True
@@ -56,9 +57,13 @@ def test_if_empty_list_or_none(obj) -> bool:
56
57
58
return False
59
- return cls(**{
60
- k: v for k, v in self.dict().items() if not test_if_empty_list_or_none(v)
61
- })
+ return cls(
+ **{
62
+ k: v
63
+ for k, v in self.dict().items()
64
+ if not test_if_empty_list_or_none(v)
65
+ }
66
+ )
67
68
69
@_basemodel_decorator
0 commit comments