Skip to content

Commit c0c8da3

Browse files
abhijeet-dhumalntkathole
authored andcommitted
fix: graceful fallback when offline path is not readable
Signed-off-by: abhijeet-dhumal <abhijeetdhumal652@gmail.com>
1 parent 03a617e commit c0c8da3

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

  • sdk/python/feast/infra/offline_stores/contrib/spark_offline_store

sdk/python/feast/infra/offline_stores/contrib/spark_offline_store/spark.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,21 @@ def _apply_bfv_transformations_for_historical(
112112
):
113113
tmp_view = f"__feast_offline_{ctx.name}_{uuid.uuid4().hex[:8]}"
114114
file_format = fv.batch_source.file_format or "parquet"
115-
df = spark_session.read.format(file_format).load(fv.batch_source.path)
116-
df.createOrReplaceTempView(tmp_view)
117-
ctx = replace(ctx, table_subquery=tmp_view)
118-
elif (
115+
try:
116+
df = spark_session.read.format(file_format).load(fv.batch_source.path)
117+
df.createOrReplaceTempView(tmp_view)
118+
ctx = replace(ctx, table_subquery=tmp_view)
119+
new_contexts.append(ctx)
120+
continue
121+
except Exception:
122+
warnings.warn(
123+
f"Offline path '{fv.batch_source.path}' not readable for "
124+
f"'{ctx.name}'; falling back to source query.",
125+
RuntimeWarning,
126+
stacklevel=2,
127+
)
128+
129+
if (
119130
hasattr(fv, "feature_transformation")
120131
and fv.feature_transformation is not None
121132
and (

0 commit comments

Comments
 (0)