SIENTIAPDE-1250: Fix: Update pip cache key and replace pytz with datetime.UTC in experiment tracking.
This commit is contained in:
@@ -10,11 +10,10 @@ from temporalio import activity, workflow
|
||||
|
||||
with workflow.unsafe.imports_passed_through():
|
||||
import traceback
|
||||
from datetime import datetime
|
||||
from datetime import UTC, datetime
|
||||
from enum import Enum
|
||||
from typing import Any
|
||||
|
||||
import pytz
|
||||
from sientia_do.notifications.handlers import CoreNotificationHandler as NotificationHandler
|
||||
from sientia_do.notifications.models import NotificationLevel
|
||||
from sientia_do.observability.logger import Logger
|
||||
@@ -161,7 +160,7 @@ class ExperimentTracking(Postgres):
|
||||
SET status = %s, updated_at = %s
|
||||
WHERE id = %s
|
||||
"""
|
||||
query_params = (status, datetime.now(pytz.utc), experiment_run_id)
|
||||
query_params = (status, datetime.now(UTC), experiment_run_id)
|
||||
|
||||
elif update_type == UpdateType.STATUS_WITH_ERROR:
|
||||
if not status or not error_message:
|
||||
@@ -178,7 +177,12 @@ class ExperimentTracking(Postgres):
|
||||
SET status = %s, error_message = %s, updated_at = %s
|
||||
WHERE id = %s
|
||||
"""
|
||||
query_params = (status, error_message, datetime.now(pytz.utc), experiment_run_id)
|
||||
query_params = (
|
||||
status,
|
||||
error_message,
|
||||
datetime.now(UTC),
|
||||
experiment_run_id,
|
||||
)
|
||||
|
||||
elif update_type == UpdateType.MODEL_SAVED:
|
||||
if not run_name:
|
||||
@@ -188,7 +192,7 @@ class ExperimentTracking(Postgres):
|
||||
SET run_name = %s, status = %s, updated_at = %s
|
||||
WHERE id = %s
|
||||
"""
|
||||
query_params = (run_name, status, datetime.now(pytz.utc), experiment_run_id)
|
||||
query_params = (run_name, status, datetime.now(UTC), experiment_run_id)
|
||||
|
||||
else:
|
||||
raise ValueError(f'Invalid update_type: {update_type}')
|
||||
|
||||
Reference in New Issue
Block a user