Skip to content
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
16 changes: 7 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name = "feast"
description = "Python SDK for Feast"
readme = "README.md"
requires-python = ">=3.10.0"
license = {file = "LICENSE"}
license = "Apache-2.0"
license-files = ["LICENSE"]
classifiers = [
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10"
Expand All @@ -23,7 +23,7 @@ dependencies = [
"mmh3",
"numpy>=2.0.0,<3",
"pandas>=1.4.3,<3",
"pyarrow<=21.0.0",
"pyarrow>=21.0.0",
"pydantic>=2.10.6",
"pygments>=2.12.0,<3",
"PyYAML>=5.4.0,<7",
Expand Down Expand Up @@ -59,7 +59,7 @@ clickhouse = ["clickhouse-connect>=0.7.19"]
couchbase = ["couchbase==4.3.2", "couchbase-columnar==1.0.0"]
delta = ["deltalake<1.0.0"]
docling = ["docling==2.27.0"]
duckdb = ["ibis-framework[duckdb]>=9.0.0,<=9.5.0"]
duckdb = ["ibis-framework[duckdb]>=10.0.0"]
elasticsearch = ["elasticsearch>=8.13.0"]
faiss = ["faiss-cpu>=1.7.0,<=1.10.0"]
gcp = [
Expand All @@ -82,9 +82,7 @@ grpcio = [
hazelcast = ["hazelcast-python-client>=5.1"]
hbase = ["happybase>=1.2.0,<3"]
ibis = [
"ibis-framework>=9.0.0,<=9.5.0",
"ibis-substrait>=4.0.0",
"substrait<0.25.0", # TODO: remove this once we upgrade protobuf
"ibis-framework>=10.0.0",
"poetry-core<2",
"poetry-dynamic-versioning",
]
Expand All @@ -99,11 +97,11 @@ image = [
"scikit-learn>=1.0.0",
]
milvus = [
"pymilvus==2.4.15",
"pymilvus>2.5",
"milvus-lite==2.4.12",
"feast[setuptools]"
]
mssql = ["ibis-framework[mssql]>=9.0.0,<=9.5.0"]
mssql = ["ibis-framework[mssql]>=10.0.0"]
mysql = ["pymysql", "types-PyMySQL"]
opentelemetry = ["prometheus_client", "psutil"]
spark = ["pyspark>=4.0.0"]
Expand Down
11 changes: 6 additions & 5 deletions sdk/python/feast/infra/offline_stores/duckdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ def _read_data_source(data_source: DataSource, repo_path: str) -> Table:
if isinstance(data_source.file_format, ParquetFormat):
return ibis.read_parquet(data_source.path)
elif isinstance(data_source.file_format, DeltaFormat):
storage_options = {
"AWS_ENDPOINT_URL": data_source.s3_endpoint_override,
}

return ibis.read_delta(data_source.path, storage_options=storage_options)
if data_source.s3_endpoint_override:
storage_options = {
"AWS_ENDPOINT_URL": data_source.s3_endpoint_override,
}
return ibis.read_delta(data_source.path, storage_options=storage_options)
return ibis.read_delta(data_source.path)


def _write_data_source(
Expand Down
17 changes: 12 additions & 5 deletions sdk/python/feast/infra/offline_stores/ibis.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from typing import Any, Callable, Dict, List, Optional, Tuple, Union

import ibis
import ibis.selectors as s
import numpy as np
import pandas as pd
import pyarrow
Expand Down Expand Up @@ -393,6 +392,10 @@ def point_in_time_join(

acc_table = entity_table

# Track the columns we want to keep explicitly
entity_columns = list(entity_table.columns)
all_feature_cols: List[str] = []

for (
feature_table,
timestamp_field,
Expand Down Expand Up @@ -432,7 +435,8 @@ def point_in_time_join(
entity_table, predicates, lname="", rname="{name}_y"
)

feature_table = feature_table.drop(s.endswith("_y"))
cols_to_drop_y = [c for c in feature_table.columns if c.endswith("_y")]
feature_table = feature_table.drop(*cols_to_drop_y)

feature_table = deduplicate(
table=feature_table,
Expand All @@ -445,16 +449,19 @@ def point_in_time_join(
select_cols.extend(feature_refs)
feature_table = feature_table.select(select_cols)

# Track the feature columns we're adding
all_feature_cols.extend(feature_refs)

acc_table = acc_table.left_join(
feature_table,
predicates=[feature_table.entity_row_id == acc_table.entity_row_id],
lname="",
rname="{name}_yyyy",
)

acc_table = acc_table.drop(s.endswith("_yyyy"))

acc_table = acc_table.drop("entity_row_id")
# Select only the columns we want: entity columns (minus entity_row_id) + all feature columns
final_cols = [c for c in entity_columns if c != "entity_row_id"] + all_feature_cols
acc_table = acc_table.select(final_cols)

return acc_table

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,11 @@ def _get_or_create_collection(
index_name=f"vector_index_{vector_field.name}",
params={"nlist": config.online_store.nlist},
)
self.client.create_index(
collection_name=collection_name,
index_params=index_params,
)
if len(index_params) > 0:
self.client.create_index(
collection_name=collection_name,
index_params=index_params,
)
else:
self.client.load_collection(collection_name)
self._collections[collection_name] = self.client.describe_collection(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,14 @@ def from_ibis(cls, user_function, sources):

import ibis
import ibis.expr.datatypes as dt
from ibis_substrait.compiler.core import SubstraitCompiler

try:
from ibis_substrait.compiler.core import SubstraitCompiler
except ImportError:
raise ImportError(
"Failed to use substrait transformation: 'ibis-substrait' package is not installed. "
"Install it with: `pip install ibis-substrait and only if https://github.com/ibis-project/ibis-substrait/issues/1309 issue is resolved."
)

compiler = SubstraitCompiler()

Expand Down
1 change: 0 additions & 1 deletion sdk/python/pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@ filterwarnings =
ignore::DeprecationWarning:httpx.*:
ignore::DeprecationWarning:happybase.*:
ignore::DeprecationWarning:pkg_resources.*:
ignore::FutureWarning:ibis_substrait.compiler.*:
Loading
Loading