diff --git a/sdk/python/feast/infra/online_stores/sqlite.py b/sdk/python/feast/infra/online_stores/sqlite.py index a5c8397e0d3..07180fe75ed 100644 --- a/sdk/python/feast/infra/online_stores/sqlite.py +++ b/sdk/python/feast/infra/online_stores/sqlite.py @@ -16,9 +16,20 @@ import os import sqlite3 import sys -from datetime import date, datetime +from datetime import date, datetime, timezone from pathlib import Path -from typing import Any, Callable, Dict, List, Literal, Optional, Sequence, Tuple, Union +from typing import ( + Any, + Callable, + Dict, + List, + Literal, + Optional, + Sequence, + Tuple, + Union, + cast, +) from pydantic import StrictStr @@ -264,7 +275,11 @@ def online_read( val = ValueProto() val.ParseFromString(val_bin) res[feature_name] = val - res_ts = ts + ts = cast(datetime, ts) + if ts.tzinfo is not None: + res_ts = ts.astimezone(timezone.utc) + else: + res_ts = ts.replace(tzinfo=timezone.utc) if not res: result.append((None, None))