Skip to content

Commit

Permalink
PEP8 #2714
Browse files Browse the repository at this point in the history
  • Loading branch information
iamleeg committed Jun 20, 2022
1 parent d3c3d47 commit fab92ee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from typing import Any


@dataclasses.dataclass()
class DayZeroCase:
"""This class implements the "day-zero" data schema for Global.health.
Expand Down Expand Up @@ -31,7 +32,9 @@ def from_dict(cls, dictionary: dict[str, Any]) -> type:
for key in dictionary:
if key in ["confirmation_date"]:
# parse as an ISO 8601 date
date_dt = datetime.datetime.strptime(dictionary[key], "%Y-%m-%dT%H:%M:%S.%fZ")
date_dt = datetime.datetime.strptime(
dictionary[key], "%Y-%m-%dT%H:%M:%S.%fZ"
)
date = date_dt.date()
setattr(case, key, date)
else:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import flask.json
import datetime


class ISOJSONEncoder(flask.json.JSONEncoder):
def default(self, obj):
try:
Expand Down

0 comments on commit fab92ee

Please sign in to comment.