Skip to content

Commit 4b37fff

Browse files
committed
feat: Improve data source page UX
Signed-off-by: ntkathole <nikhilkathole2683@gmail.com>
1 parent ebc5692 commit 4b37fff

22 files changed

Lines changed: 2738 additions & 358 deletions

‎protos/feast/registry/RegistryServer.proto‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ service RegistryServer{
3232
rpc GetDataSource (GetDataSourceRequest) returns (feast.core.DataSource) {}
3333
rpc ListDataSources (ListDataSourcesRequest) returns (ListDataSourcesResponse) {}
3434
rpc DeleteDataSource (DeleteDataSourceRequest) returns (google.protobuf.Empty) {}
35+
rpc ValidateDataSource (ValidateDataSourceRequest) returns (ValidateDataSourceResponse) {}
3536

3637
// FeatureView RPCs
3738
rpc ApplyFeatureView (ApplyFeatureViewRequest) returns (google.protobuf.Empty) {}
@@ -224,6 +225,27 @@ message DeleteDataSourceRequest {
224225
bool commit = 3;
225226
}
226227

228+
message ValidateDataSourceRequest {
229+
string name = 1;
230+
string project = 2;
231+
bool allow_cache = 3;
232+
}
233+
234+
message ValidateDataSourceColumn {
235+
string name = 1;
236+
string type = 2;
237+
}
238+
239+
message ValidateDataSourceResponse {
240+
string name = 1;
241+
string project = 2;
242+
// One of: "success", "failed", "not_applicable", "unavailable".
243+
string status = 3;
244+
string message = 4;
245+
string tested_at = 5;
246+
repeated ValidateDataSourceColumn columns = 6;
247+
}
248+
227249
// FeatureViews
228250

229251
message ApplyFeatureViewRequest {

‎sdk/python/feast/api/registry/rest/data_sources.py‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,4 +357,24 @@ def delete_data_source(
357357

358358
return {"name": name, "project": project, "status": "deleted"}
359359

360+
@router.post("/data_sources/{name}/validate")
361+
def validate_data_source(
362+
name: str,
363+
project: str = Query(...),
364+
allow_cache: bool = Query(default=True),
365+
) -> Dict:
366+
"""Test connectivity to a data source's underlying storage.
367+
368+
Delegates to the ``ValidateDataSource`` gRPC method, which enforces the
369+
same ``DESCRIBE`` permission check as ``GetDataSource`` before probing
370+
the source. Returns ``status`` of success / failed / not_applicable /
371+
unavailable along with the discovered column schema on success.
372+
"""
373+
req = RegistryServer_pb2.ValidateDataSourceRequest(
374+
name=name,
375+
project=project,
376+
allow_cache=allow_cache,
377+
)
378+
return grpc_call(grpc_handler.ValidateDataSource, req)
379+
360380
return router

‎sdk/python/feast/api/registry/rest/saved_datasets.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
grpc_call,
1818
parse_tags,
1919
)
20+
from feast.errors import FeastPermissionError
2021
from feast.protos.feast.core.DataSource_pb2 import DataSource as DataSourceProto
2122
from feast.protos.feast.core.SavedDataset_pb2 import (
2223
SavedDataset as SavedDatasetProto,
@@ -572,6 +573,10 @@ def create_dataset(payload: CreateDatasetRequest = Body(...)):
572573
)
573574
try:
574575
result = grpc_call(grpc_handler.CreateDatasetFromRetrieval, req)
576+
except FeastPermissionError as e:
577+
raise HTTPException(status_code=403, detail=str(e))
578+
except ValueError as e:
579+
raise HTTPException(status_code=400, detail=str(e))
575580
except Exception as e:
576581
raise HTTPException(
577582
status_code=500,

‎sdk/python/feast/protos/feast/core/DataSource_pb2.pyi‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,9 @@ class DataSource(google.protobuf.message.Message):
527527
UPSTREAM_FEATURE_VIEW_NAMES_FIELD_NUMBER: builtins.int
528528
@property
529529
def upstream_feature_view_names(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]:
530-
"""Names of upstream FeatureViews consumed by the process feeding this PushSource"""
530+
"""Names of upstream FeatureViews/LabelViews consumed by the external process feeding this PushSource.
531+
Represents external pipeline lineage metadata; does not trigger Feast-managed DAG execution.
532+
"""
531533
def __init__(
532534
self,
533535
*,

‎sdk/python/feast/protos/feast/registry/RegistryServer_pb2.py‎

Lines changed: 135 additions & 129 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎sdk/python/feast/protos/feast/registry/RegistryServer_pb2.pyi‎

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,74 @@ class DeleteDataSourceRequest(google.protobuf.message.Message):
470470

471471
global___DeleteDataSourceRequest = DeleteDataSourceRequest
472472

473+
class ValidateDataSourceRequest(google.protobuf.message.Message):
474+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
475+
476+
NAME_FIELD_NUMBER: builtins.int
477+
PROJECT_FIELD_NUMBER: builtins.int
478+
ALLOW_CACHE_FIELD_NUMBER: builtins.int
479+
name: builtins.str
480+
project: builtins.str
481+
allow_cache: builtins.bool
482+
def __init__(
483+
self,
484+
*,
485+
name: builtins.str = ...,
486+
project: builtins.str = ...,
487+
allow_cache: builtins.bool = ...,
488+
) -> None: ...
489+
def ClearField(self, field_name: typing_extensions.Literal["allow_cache", b"allow_cache", "name", b"name", "project", b"project"]) -> None: ...
490+
491+
global___ValidateDataSourceRequest = ValidateDataSourceRequest
492+
493+
class ValidateDataSourceColumn(google.protobuf.message.Message):
494+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
495+
496+
NAME_FIELD_NUMBER: builtins.int
497+
TYPE_FIELD_NUMBER: builtins.int
498+
name: builtins.str
499+
type: builtins.str
500+
def __init__(
501+
self,
502+
*,
503+
name: builtins.str = ...,
504+
type: builtins.str = ...,
505+
) -> None: ...
506+
def ClearField(self, field_name: typing_extensions.Literal["name", b"name", "type", b"type"]) -> None: ...
507+
508+
global___ValidateDataSourceColumn = ValidateDataSourceColumn
509+
510+
class ValidateDataSourceResponse(google.protobuf.message.Message):
511+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
512+
513+
NAME_FIELD_NUMBER: builtins.int
514+
PROJECT_FIELD_NUMBER: builtins.int
515+
STATUS_FIELD_NUMBER: builtins.int
516+
MESSAGE_FIELD_NUMBER: builtins.int
517+
TESTED_AT_FIELD_NUMBER: builtins.int
518+
COLUMNS_FIELD_NUMBER: builtins.int
519+
name: builtins.str
520+
project: builtins.str
521+
status: builtins.str
522+
"""One of: "success", "failed", "not_applicable", "unavailable"."""
523+
message: builtins.str
524+
tested_at: builtins.str
525+
@property
526+
def columns(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___ValidateDataSourceColumn]: ...
527+
def __init__(
528+
self,
529+
*,
530+
name: builtins.str = ...,
531+
project: builtins.str = ...,
532+
status: builtins.str = ...,
533+
message: builtins.str = ...,
534+
tested_at: builtins.str = ...,
535+
columns: collections.abc.Iterable[global___ValidateDataSourceColumn] | None = ...,
536+
) -> None: ...
537+
def ClearField(self, field_name: typing_extensions.Literal["columns", b"columns", "message", b"message", "name", b"name", "project", b"project", "status", b"status", "tested_at", b"tested_at"]) -> None: ...
538+
539+
global___ValidateDataSourceResponse = ValidateDataSourceResponse
540+
473541
class ApplyFeatureViewRequest(google.protobuf.message.Message):
474542
"""FeatureViews"""
475543

‎sdk/python/feast/protos/feast/registry/RegistryServer_pb2_grpc.py‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ def __init__(self, channel):
6868
request_serializer=feast_dot_registry_dot_RegistryServer__pb2.DeleteDataSourceRequest.SerializeToString,
6969
response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
7070
)
71+
self.ValidateDataSource = channel.unary_unary(
72+
'/feast.registry.RegistryServer/ValidateDataSource',
73+
request_serializer=feast_dot_registry_dot_RegistryServer__pb2.ValidateDataSourceRequest.SerializeToString,
74+
response_deserializer=feast_dot_registry_dot_RegistryServer__pb2.ValidateDataSourceResponse.FromString,
75+
)
7176
self.ApplyFeatureView = channel.unary_unary(
7277
'/feast.registry.RegistryServer/ApplyFeatureView',
7378
request_serializer=feast_dot_registry_dot_RegistryServer__pb2.ApplyFeatureViewRequest.SerializeToString,
@@ -358,6 +363,12 @@ def DeleteDataSource(self, request, context):
358363
context.set_details('Method not implemented!')
359364
raise NotImplementedError('Method not implemented!')
360365

366+
def ValidateDataSource(self, request, context):
367+
"""Missing associated documentation comment in .proto file."""
368+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
369+
context.set_details('Method not implemented!')
370+
raise NotImplementedError('Method not implemented!')
371+
361372
def ApplyFeatureView(self, request, context):
362373
"""FeatureView RPCs
363374
"""
@@ -696,6 +707,11 @@ def add_RegistryServerServicer_to_server(servicer, server):
696707
request_deserializer=feast_dot_registry_dot_RegistryServer__pb2.DeleteDataSourceRequest.FromString,
697708
response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
698709
),
710+
'ValidateDataSource': grpc.unary_unary_rpc_method_handler(
711+
servicer.ValidateDataSource,
712+
request_deserializer=feast_dot_registry_dot_RegistryServer__pb2.ValidateDataSourceRequest.FromString,
713+
response_serializer=feast_dot_registry_dot_RegistryServer__pb2.ValidateDataSourceResponse.SerializeToString,
714+
),
699715
'ApplyFeatureView': grpc.unary_unary_rpc_method_handler(
700716
servicer.ApplyFeatureView,
701717
request_deserializer=feast_dot_registry_dot_RegistryServer__pb2.ApplyFeatureViewRequest.FromString,
@@ -1077,6 +1093,23 @@ def DeleteDataSource(request,
10771093
options, channel_credentials,
10781094
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
10791095

1096+
@staticmethod
1097+
def ValidateDataSource(request,
1098+
target,
1099+
options=(),
1100+
channel_credentials=None,
1101+
call_credentials=None,
1102+
insecure=False,
1103+
compression=None,
1104+
wait_for_ready=None,
1105+
timeout=None,
1106+
metadata=None):
1107+
return grpc.experimental.unary_unary(request, target, '/feast.registry.RegistryServer/ValidateDataSource',
1108+
feast_dot_registry_dot_RegistryServer__pb2.ValidateDataSourceRequest.SerializeToString,
1109+
feast_dot_registry_dot_RegistryServer__pb2.ValidateDataSourceResponse.FromString,
1110+
options, channel_credentials,
1111+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
1112+
10801113
@staticmethod
10811114
def ApplyFeatureView(request,
10821115
target,

0 commit comments

Comments
 (0)