Skip to content

Commit

Permalink
fix: Deprecated the datetime.utcfromtimestamp(). (feast-dev#4306)
Browse files Browse the repository at this point in the history
  • Loading branch information
shuchu authored Jun 25, 2024
1 parent de5b0eb commit 21deec8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions sdk/python/feast/infra/registry/snowflake.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os
import uuid
from binascii import hexlify
from datetime import datetime, timedelta
from datetime import datetime, timedelta, timezone
from enum import Enum
from threading import Lock
from typing import Any, Callable, List, Literal, Optional, Set, Union
Expand Down Expand Up @@ -994,7 +994,7 @@ def _get_last_updated_metadata(self, project: str):
if df.empty:
return None

return datetime.utcfromtimestamp(int(df.squeeze()))
return datetime.fromtimestamp(int(df.squeeze()), tz=timezone.utc)

def _infer_fv_classes(self, feature_view):
if isinstance(feature_view, StreamFeatureView):
Expand Down
4 changes: 2 additions & 2 deletions sdk/python/feast/infra/registry/sql.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging
import uuid
from datetime import datetime
from datetime import datetime, timezone
from enum import Enum
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional, Set, Union
Expand Down Expand Up @@ -903,7 +903,7 @@ def _get_last_updated_metadata(self, project: str):
return None
update_time = int(row._mapping["last_updated_timestamp"])

return datetime.utcfromtimestamp(update_time)
return datetime.fromtimestamp(update_time, tz=timezone.utc)

def _get_all_projects(self) -> Set[str]:
projects = set()
Expand Down

0 comments on commit 21deec8

Please sign in to comment.