Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Deprecated the datetime.utcfromtimestamp(). #4306

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading