Skip to content

Commit 7b1a8bc

Browse files
authored
Merge pull request #338 from roboflow/leo/null-updated-timestamp
Allow null "updated" or "created" timestamps
2 parents 0d6b37d + cbeab9d commit 7b1a8bc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

roboflow/core/project.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def __init__(self, api_key: str, a_project: dict, model_format: Optional[str] =
6060
self.annotation = a_project["annotation"]
6161
self.classes = a_project["classes"]
6262
self.colors = a_project["colors"]
63-
self.created = datetime.datetime.fromtimestamp(a_project["created"])
63+
self.created = datetime.datetime.fromtimestamp(a_project["created"]) if a_project["created"] else None
6464
self.id = a_project["id"]
6565
self.images = a_project["images"]
6666
self.name = a_project["name"]
@@ -69,7 +69,7 @@ def __init__(self, api_key: str, a_project: dict, model_format: Optional[str] =
6969
self.type = a_project["type"]
7070
self.multilabel = a_project.get("multilabel", False)
7171
self.unannotated = a_project["unannotated"]
72-
self.updated = datetime.datetime.fromtimestamp(a_project["updated"])
72+
self.updated = datetime.datetime.fromtimestamp(a_project["updated"]) if a_project["updated"] else None
7373
self.model_format = model_format
7474

7575
temp = self.id.rsplit("/")

0 commit comments

Comments
 (0)