Skip to content

Commit

Permalink
Merge pull request #18 from DukeAbigor/master
Browse files Browse the repository at this point in the history
Corrected nullable datetimes in nation model
  • Loading branch information
mrvillage authored Feb 12, 2024
2 parents 832710f + 3ed15c6 commit 8218f2d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions pnwkit/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,15 @@ class Nation(Data):
"tax_id": int,
"last_active": datetime.datetime.fromisoformat,
"date": datetime.datetime.fromisoformat,
"moon_landing_date": datetime.datetime.fromisoformat,
"mars_landing_date": datetime.datetime.fromisoformat,
"alliance_join_date": datetime.datetime.fromisoformat,
"moon_landing_date": lambda x: None
if x is None
else datetime.datetime.fromisoformat(x),
"mars_landing_date": lambda x: None
if x is None
else datetime.datetime.fromisoformat(x),
"alliance_join_date": lambda x: None
if x is None
else datetime.datetime.fromisoformat(x),
"economic_policy": EconomicPolicy.__members__.get,
"social_policy": SocialPolicy.__members__.get,
"government_type": GovernmentType.__members__.get,
Expand Down

0 comments on commit 8218f2d

Please sign in to comment.