Skip to content

Commit 0b43d2c

Browse files
tonylampadaclaude
andcommitted
chore: alias datetime as dt for ruff ICN001
Newer ruff (unpinned in CI) flags these two imports, failing check_code_quality. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 55f6217 commit 0b43d2c

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎roboflow/cli/handlers/project.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,9 @@ def _get_project(args): # noqa: ANN001
201201
if key in project:
202202
val = project[key]
203203
if key in epoch_keys and isinstance(val, (int, float)):
204-
import datetime
204+
import datetime as dt
205205

206-
val = datetime.datetime.fromtimestamp(val).strftime("%Y-%m-%d %H:%M:%S")
206+
val = dt.datetime.fromtimestamp(val).strftime("%Y-%m-%d %H:%M:%S")
207207
elif isinstance(val, dict):
208208
val = ", ".join(f"{k}: {v}" for k, v in val.items())
209209
lines.append(f" {label:12s} {val}")

‎roboflow/core/project.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import datetime
1+
import datetime as dt
22
import json
33
import mimetypes
44
import os
@@ -68,7 +68,7 @@ def __init__(self, api_key: str, a_project: dict, model_format: Optional[str] =
6868
self.annotation = a_project["annotation"]
6969
self.classes = a_project["classes"]
7070
self.colors = a_project["colors"]
71-
self.created = datetime.datetime.fromtimestamp(a_project["created"])
71+
self.created = dt.datetime.fromtimestamp(a_project["created"])
7272
self.id = a_project["id"]
7373
self.images = a_project["images"]
7474
self.name = a_project["name"]
@@ -77,7 +77,7 @@ def __init__(self, api_key: str, a_project: dict, model_format: Optional[str] =
7777
self.type = a_project["type"]
7878
self.multilabel = a_project.get("multilabel", False)
7979
self.unannotated = a_project["unannotated"]
80-
self.updated = datetime.datetime.fromtimestamp(a_project["updated"])
80+
self.updated = dt.datetime.fromtimestamp(a_project["updated"])
8181
self.model_format = model_format
8282

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

0 commit comments

Comments
 (0)