Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix testing
Signed-off-by: HaoXuAI <sduxuhao@gmail.com>
  • Loading branch information
HaoXuAI committed Jul 8, 2025
commit d2eb23f7a57baf913d56b6d096d876046b079f27
10 changes: 10 additions & 0 deletions sdk/python/feast/batch_feature_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from feast.entity import Entity
from feast.feature_view import FeatureView
from feast.field import Field
from feast.protos.feast.core.DataSource_pb2 import DataSource as DataSourceProto
from feast.transformation.base import Transformation
from feast.transformation.mode import TransformationMode

Expand Down Expand Up @@ -97,6 +98,15 @@ def __init__(
RuntimeWarning,
)

if isinstance(source, DataSource) and (
type(source).__name__ not in SUPPORTED_BATCH_SOURCES
and source.to_proto().type != DataSourceProto.SourceType.CUSTOM_SOURCE
):
raise ValueError(
f"Batch feature views need a batch source, expected one of {SUPPORTED_BATCH_SOURCES} "
f"or CUSTOM_SOURCE, got {type(source).__name__}: {source.name} instead "
)

self.mode = mode
self.udf = udf
self.udf_string = udf_string
Expand Down
1 change: 0 additions & 1 deletion sdk/python/feast/infra/compute_engines/spark/compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ def _materialize_one(
)

except Exception as e:
raise e
# 🛑 Handle failure
return SparkMaterializationJob(
job_id=job_id, status=MaterializationJobStatus.ERROR, error=e
Expand Down
9 changes: 6 additions & 3 deletions sdk/python/feast/stream_feature_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class StreamFeatureView(FeatureView):
entities: List[str]
ttl: Optional[timedelta]
source: DataSource
sink_source: Optional[DataSource] = None
schema: List[Field]
entity_columns: List[Field]
features: List[Field]
Expand All @@ -90,7 +91,8 @@ def __init__(
self,
*,
name: str,
source: DataSource,
source: Union[DataSource, "StreamFeatureView", List["StreamFeatureView"]],
sink_source: Optional[DataSource] = None,
entities: Optional[List[Entity]] = None,
ttl: timedelta = timedelta(days=0),
tags: Optional[Dict[str, str]] = None,
Expand All @@ -114,7 +116,7 @@ def __init__(
RuntimeWarning,
)

if (
if isinstance(source, DataSource) and (
type(source).__name__ not in SUPPORTED_STREAM_SOURCES
and source.to_proto().type != DataSourceProto.SourceType.CUSTOM_SOURCE
):
Expand Down Expand Up @@ -148,7 +150,8 @@ def __init__(
description=description,
owner=owner,
schema=schema,
source=source,
source=source, # type: ignore[arg-type]
sink_source=sink_source,
)

def get_feature_transformation(self) -> Optional[Transformation]:
Expand Down
Loading