Skip to content

Commit f2b4ace

Browse files
patelchaitanyclaude
andcommitted
fix: Resolve feature view batch source name against registry
POST /api/v1/feature_views takes the batch source as a name, but the handler turned that name into a DataSourceProto with every other field left at its default. With `type` unset, DataSource.from_proto rejected the spec with "Could not identify the source type being added.", so creating a feature view from the UI always failed. Resolve the name through the registry instead, so the feature view spec carries the registered source's type along with its options (path, timestamp columns, connection settings). Setting `type` alone would not be enough: each concrete source reads its own options out of the proto, which would persist a feature view pointing at a gutted source. An unregistered name now raises FeastObjectNotFoundException, which both the standalone REST registry server and the UI server already map to a 404 instead of the previous 500. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019AKoXg1p8EkTABGC46PBbw Signed-off-by: patelchaitany <patelchaitany93@gmail.com>
1 parent fa8f06b commit f2b4ace

1 file changed

Lines changed: 18 additions & 3 deletions

File tree

sdk/python/feast/api/registry/rest/feature_views.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from fastapi.responses import JSONResponse
77
from google.protobuf import timestamp_pb2
88
from google.protobuf.duration_pb2 import Duration
9+
from google.protobuf.json_format import ParseDict
910
from pydantic import BaseModel
1011

1112
from feast.api.registry.rest.codegen_utils import render_feature_view_code
@@ -343,9 +344,23 @@ def apply_feature_view(body: ApplyFeatureViewRequestBody):
343344
)
344345
)
345346

346-
batch_source_proto = (
347-
DataSourceProto(name=body.batch_source) if body.batch_source else None
348-
)
347+
batch_source_proto = None
348+
if body.batch_source:
349+
# The body carries only the source's name, so read the registered
350+
# source back out of the registry. A proto built from the name alone
351+
# has no type, and DataSource.from_proto then rejects it with
352+
# "Could not identify the source type being added."
353+
batch_source_proto = ParseDict(
354+
grpc_call(
355+
grpc_handler.GetDataSource,
356+
RegistryServer_pb2.GetDataSourceRequest(
357+
name=body.batch_source,
358+
project=body.project,
359+
allow_cache=False,
360+
),
361+
),
362+
DataSourceProto(),
363+
)
349364

350365
ttl = (
351366
Duration(seconds=body.ttl_seconds) if body.ttl_seconds is not None else None

0 commit comments

Comments
 (0)