Skip to content

Commit

Permalink
Handle none starting time for a player (#40)
Browse files Browse the repository at this point in the history
### Summary

Closes #37
  • Loading branch information
jaebradley authored Sep 17, 2020
1 parent 5cf5090 commit f687ffb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion draft_kings/response_translators.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ def translate_player(response):
return {
"id": dig(response, "pid"),
"draft": {
"starts_at": dig(response, "dgst", transformer=from_unix_milliseconds_to_datetime),
"starts_at": dig(
response, "dgst",
transformer=lambda value: None if value is None else from_unix_milliseconds_to_datetime(value)
),
"draftable": dig(response, "IsDisabledFromDrafting", transformer=lambda value: value is False, fallback=False),
"salary": dig(response, "s", transformer=float),
"exceptional_messages": dig(response, "ExceptionalMessages"),
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="draft_kings",
version="2.0.1",
version="2.0.2",
author="Jae Bradley",
author_email="[email protected]",
license="MIT",
Expand Down

0 comments on commit f687ffb

Please sign in to comment.