Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
cff3a63
feat: Add Oracle DB as Offline store in python sdk & support in feas…
aniketpalu Feb 24, 2026
60f8d92
Added oracle db dependency from ibis-framework subgroups
aniketpalu Feb 24, 2026
9f00168
Operator yaml changes
aniketpalu Feb 24, 2026
07e6969
Data source writer ignored parameters, fixed
aniketpalu Feb 24, 2026
1fb6720
Replaced raw sql with dedicated truncate_table() to fix SQL Injection…
aniketpalu Feb 26, 2026
3abef8c
Minor improvements like single db connection, removal of default cred…
aniketpalu Feb 28, 2026
b991288
Fetching pre-filtered table from db
aniketpalu Mar 2, 2026
af7e7ee
Minor formatting changes
aniketpalu Mar 2, 2026
41e0901
Added Oracle DB Offline Store documentation
aniketpalu Mar 2, 2026
d4387a8
Resolved import error by removing OracleSource import from the __init__
aniketpalu Mar 2, 2026
b0e96d0
Fixed lint error by updating secret baseline
aniketpalu Mar 5, 2026
07c5e9a
fix: Exclude qdrant from docstring tests to avoid qdrant-client 1.17.…
aniketpalu Mar 5, 2026
be03d88
Generated secret.baseline to avoid lint error
aniketpalu Mar 5, 2026
c36299f
Fixed lint error
aniketpalu Mar 5, 2026
7e648c0
Updated .secrets.baseline
aniketpalu Mar 5, 2026
7573690
Fixed lint errors
aniketpalu Mar 6, 2026
1a78577
Fixed lint errors
aniketpalu Mar 6, 2026
8fc6190
Update sdk/python/feast/type_map.py
aniketpalu Mar 6, 2026
1f63beb
Updated dependency lock files
aniketpalu Mar 9, 2026
33c0b38
Fixed lint issues in Trino Offline Store
aniketpalu Mar 9, 2026
04adc97
Merge branch 'master' into oracle-db-offline-store
aniketpalu Mar 9, 2026
e91fa8d
Updated requirements
aniketpalu Mar 9, 2026
caed7c8
Updated pixi.lock file
aniketpalu Mar 9, 2026
de9759e
Merge branch 'master' into oracle-db-offline-store
aniketpalu Mar 9, 2026
e40a355
Merge branch 'master' into oracle-db-offline-store
aniketpalu Mar 9, 2026
c71cdfd
Merge branch 'master' into oracle-db-offline-store
aniketpalu Mar 9, 2026
9a20c65
Merge branch 'master' into oracle-db-offline-store
aniketpalu Mar 10, 2026
9880a56
Merge branch 'master' into oracle-db-offline-store
aniketpalu Mar 10, 2026
5335b0d
Restricted non-empty feature_views in get_historical_features() to av…
aniketpalu Mar 10, 2026
c706b0b
Removed _build_data_source_reader_for_retrieval function
aniketpalu Mar 10, 2026
414c0e0
Modified initial query to be _ to avoid empty string casting to Null …
aniketpalu Mar 10, 2026
5b84e73
cast DATE to TIMESTAMP in _read_oracle_table to preserve time lost by…
aniketpalu Mar 10, 2026
92f78ca
Use single database connection for pull_latest_from_table_or_query()
aniketpalu Mar 10, 2026
c79ba55
Improved readibility by breaking down the code into functions
aniketpalu Mar 10, 2026
95f7f55
Merge branch 'master' into oracle-db-offline-store
aniketpalu Mar 10, 2026
1181be1
Merge branch 'master' into oracle-db-offline-store
aniketpalu Mar 10, 2026
b54c2a2
Updated .secret.baseline
aniketpalu Mar 10, 2026
fe797ed
Updated .secret.baseline and pixi.lock
aniketpalu Mar 10, 2026
466e2d2
Fixed lint issue
aniketpalu Mar 10, 2026
7670a90
Conflicts resolved
aniketpalu Mar 11, 2026
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
Prev Previous commit
Next Next commit
Removed _build_data_source_reader_for_retrieval function
Signed-off-by: Aniket Paluskar <apaluska@redhat.com>
  • Loading branch information
aniketpalu committed Mar 10, 2026
commit c706b0be442e35a201b8ee30b43523bc95e3ee09
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from datetime import datetime, timedelta, timezone
from pathlib import Path
from typing import Any, Callable, List, Literal, Optional, Tuple, Union
from typing import Any, Callable, List, Literal, Optional, Union

import ibis
import pandas as pd
Expand Down Expand Up @@ -62,11 +62,7 @@ def _read_oracle_table(con, data_source: DataSource) -> Table:


def _build_data_source_reader(config: RepoConfig, con=None):
"""Build a reader that returns Oracle-backend ibis tables.

Used by ``pull_latest`` and ``pull_all`` where all operations happen on a
single backend (Oracle) and no cross-backend joins are needed.
"""
"""Build a reader that returns Oracle-backend ibis tables."""
if con is None:
con = get_ibis_connection(config)

Expand All @@ -76,49 +72,6 @@ def _read_data_source(data_source: DataSource, repo_path: str = "") -> Table:
return _read_data_source


def _build_data_source_reader_for_retrieval(
config: RepoConfig,
con=None,
entity_ts_range: Optional[Tuple[datetime, datetime]] = None,
max_ttl: Optional[timedelta] = None,
):
"""Build a reader that materializes Oracle data into an in-memory table.

Used by ``get_historical_features`` which joins feature tables with an
in-memory entity table (``ibis.memtable``). Both sides must be on the
same backend for computed columns like ``entity_row_id`` to survive the
join — converting to memtable ensures this.

When ``entity_ts_range`` is provided the reader pre-filters the Oracle
table by timestamp before materializing, so only the rows relevant to
the point-in-time join are pulled into memory.
"""
if con is None:
con = get_ibis_connection(config)

def _read_data_source(data_source: DataSource, repo_path: str = "") -> Table:
table = _read_oracle_table(con, data_source)

# Pre-filter by entity timestamp range to avoid reading the
# entire table into memory. The bounds mirror what
# point_in_time_join applies later:
# feature_ts <= max(entity_ts)
# feature_ts >= min(entity_ts) - max_ttl
if entity_ts_range and data_source.timestamp_field:
ts_field = data_source.timestamp_field
if ts_field in table.columns:
lower = entity_ts_range[0] - (max_ttl or timedelta(0))
upper = entity_ts_range[1]
table = table.filter(
(table[ts_field] >= ibis.literal(lower))
& (table[ts_field] <= ibis.literal(upper))
)

return ibis.memtable(table.execute())

return _read_data_source


def _build_data_source_writer(config: RepoConfig, con=None):
"""Build a function that writes data to an Oracle table via ibis."""
if con is None:
Expand Down Expand Up @@ -282,27 +235,6 @@ def get_historical_features(
if isinstance(entity_df, str):
entity_df = con.sql(entity_df).execute()

# Compute entity timestamp range so the reader can pre-filter
# Oracle tables instead of loading them entirely into memory.
entity_ts_range: Optional[tuple] = None
if (
isinstance(entity_df, pd.DataFrame)
and "event_timestamp" in entity_df.columns
):
ts_series = pd.to_datetime(entity_df["event_timestamp"], utc=True)
entity_ts_range = (
ts_series.min().to_pydatetime(),
ts_series.max().to_pydatetime(),
)

ttl_values = [
fv.ttl for fv in feature_views if fv.ttl and isinstance(fv.ttl, timedelta)
]
max_ttl: timedelta = max(ttl_values) if ttl_values else timedelta(0)

# Use the retrieval reader which materializes Oracle data into
# in-memory tables so the point-in-time join with the entity
# memtable happens on the same backend.
return get_historical_features_ibis(
config=config,
feature_views=feature_views,
Expand All @@ -311,12 +243,7 @@ def get_historical_features(
registry=registry,
project=project,
full_feature_names=full_feature_names,
data_source_reader=_build_data_source_reader_for_retrieval(
config,
con=con,
entity_ts_range=entity_ts_range,
max_ttl=max_ttl,
),
data_source_reader=_build_data_source_reader(config, con=con),
data_source_writer=_build_data_source_writer(config, con=con),
)

Expand Down
Loading