File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
tests/test_templates/test_property_templates/test_date_property Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 7
7
if not isinstance (some_source , Unset ):
8
8
some_destination = some_source .isoformat () if some_source else None
9
9
10
- a_prop = None
11
10
_a_prop = some_destination
12
- if _a_prop is not None and not isinstance (_a_prop , Unset ):
11
+ a_prop : Union [Unset , None , datetime .date ]
12
+ if _a_prop is None :
13
+ a_prop = None
14
+ elif isinstance (_a_prop , Unset ):
15
+ a_prop = UNSET
16
+ else :
13
17
a_prop = isoparse (_a_prop ).date ()
14
18
15
19
Original file line number Diff line number Diff line change 4
4
from dateutil .parser import isoparse
5
5
some_source = date (2020 , 10 , 12 )
6
6
some_destination = some_source .isoformat () if some_source else None
7
- a_prop = None
8
7
_a_prop = some_destination
9
- if _a_prop is not None :
8
+ a_prop : Optional [datetime .date ]
9
+ if _a_prop is None :
10
+ a_prop = None
11
+ else :
10
12
a_prop = isoparse (_a_prop ).date ()
11
13
12
14
You can’t perform that action at this time.
0 commit comments