Skip to content

Commit 9c2cf95

Browse files
committed
chore: replace utcnow with now
1 parent 186d505 commit 9c2cf95

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

consumer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def query_file(config: FileClient, **kwargs):
8484
# Find the closest past item
8585
for item in data:
8686
if item["time"] <= dt.datetime.strptime(
87-
dt.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S"),
87+
dt.datetime.now(dt.timezone.utc).strftime("%Y-%m-%d %H:%M:%S"),
8888
"%Y-%m-%d %H:%M:%S",
8989
):
9090
closest_item = item

functions/model_persistence.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def save_model(path: str, topics: list[str], model):
4141
"""
4242
if path:
4343
model_prefix = f"model_{common_prefix(topics).replace('/', '_')}"
44-
now = dt.datetime.utcnow().strftime("%Y%m%d-%H%M%S")
44+
now = dt.datetime.now(dt.timezone.utc).strftime("%Y%m%d-%H%M%S")
4545
if not os.path.exists(path):
4646
os.makedirs(path)
4747
recovery_path = f"{path}/{model_prefix}_{now}.pkl"

0 commit comments

Comments
 (0)