FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat: SQLite online retrieval. Add timezone info into timestamp. by wckdman · Pull Request #5386 · feast-dev/feast · GitHub

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
21 changes: 18 additions & 3 deletions sdk/python/feast/infra/online_stores/sqlite.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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))
Expand Down

Back | FazBrowse Home | New Git URL