Skip to content

Commit be89314

Browse files
committed
fix: Support pandas mode in feature builder and fix dask column extraction
Signed-off-by: cutoutsy <cutoutsy@gmail.com>
1 parent 212504b commit be89314

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

sdk/python/feast/infra/compute_engines/feature_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def get_column_info(
158158
# we need to read ALL source columns, not just the output feature columns.
159159
# This is specifically for transformations that create new columns or need raw data.
160160
mode = getattr(getattr(view, "feature_transformation", None), "mode", None)
161-
if mode == "ray" or getattr(mode, "value", None) == "ray":
161+
if mode in ("ray", "pandas") or getattr(mode, "value", None) in ("ray", "pandas"):
162162
# Signal to read all columns by passing empty list for feature_cols
163163
# The transformation will produce the output columns defined in the schema
164164
feature_cols = []

sdk/python/feast/infra/offline_stores/dask.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,10 @@ def evaluate_func():
377377
df[DUMMY_ENTITY_ID] = DUMMY_ENTITY_VAL
378378
columns_to_extract.add(DUMMY_ENTITY_ID)
379379

380-
return df[list(columns_to_extract)].persist()
380+
if feature_name_columns:
381+
df = df[list(columns_to_extract)]
382+
383+
return df.persist()
381384

382385
# When materializing a single feature view, we don't need full feature names. On demand transforms aren't materialized
383386
return DaskRetrievalJob(
@@ -483,9 +486,10 @@ def evaluate_func():
483486
columns_to_extract.add(DUMMY_ENTITY_ID)
484487
# TODO: Decides if we want to field mapping for pull_latest_from_table_or_query
485488
# This is default for other offline store.
486-
df = df[list(columns_to_extract)]
487-
df.persist()
488-
return df
489+
if feature_name_columns:
490+
df = df[list(columns_to_extract)]
491+
492+
return df.persist()
489493

490494
# When materializing a single feature view, we don't need full feature names. On demand transforms aren't materialized
491495
return DaskRetrievalJob(

0 commit comments

Comments
 (0)