Skip to content

Commit 7e8b914

Browse files
authored
fix: Consistency in allow_cache and savedDatasets api (feast-dev#5572)
Signed-off-by: ntkathole <[email protected]>
1 parent ac2946d commit 7e8b914

File tree

14 files changed

+126
-106
lines changed

14 files changed

+126
-106
lines changed

protos/feast/registry/RegistryServer.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,4 +563,5 @@ message GetFeatureRequest {
563563
string project = 1;
564564
string feature_view = 2;
565565
string name = 3;
566+
bool allow_cache = 4;
566567
}

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,20 @@ def get_feature(
6363
include_relationships: bool = Query(
6464
False, description="Include relationships for this feature"
6565
),
66+
allow_cache: bool = Query(True),
6667
):
6768
req = RegistryServer_pb2.GetFeatureRequest(
6869
project=project,
6970
feature_view=feature_view,
7071
name=name,
72+
allow_cache=allow_cache,
7173
)
7274

7375
response = grpc_call(grpc_handler.GetFeature, req)
7476

7577
if include_relationships:
7678
response["relationships"] = get_object_relationships(
77-
grpc_handler, "feature", name, project
79+
grpc_handler, "feature", name, project, allow_cache
7880
)
7981

8082
if response:

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

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,41 +65,54 @@ async def resource_counts(
6565
project: Optional[str] = Query(
6666
None, description="Project name to filter resource counts"
6767
),
68+
allow_cache: bool = Query(True),
6869
):
6970
def count_resources_for_project(project_name: str):
7071
entities = grpc_call(
7172
grpc_handler.ListEntities,
72-
RegistryServer_pb2.ListEntitiesRequest(project=project_name),
73+
RegistryServer_pb2.ListEntitiesRequest(
74+
project=project_name, allow_cache=allow_cache
75+
),
7376
)
7477
data_sources = grpc_call(
7578
grpc_handler.ListDataSources,
76-
RegistryServer_pb2.ListDataSourcesRequest(project=project_name),
79+
RegistryServer_pb2.ListDataSourcesRequest(
80+
project=project_name, allow_cache=allow_cache
81+
),
7782
)
7883
try:
7984
saved_datasets = grpc_call(
8085
grpc_handler.ListSavedDatasets,
81-
RegistryServer_pb2.ListSavedDatasetsRequest(project=project_name),
86+
RegistryServer_pb2.ListSavedDatasetsRequest(
87+
project=project_name, allow_cache=allow_cache
88+
),
8289
)
8390
except Exception:
8491
saved_datasets = {"savedDatasets": []}
8592
try:
8693
features = grpc_call(
8794
grpc_handler.ListFeatures,
88-
RegistryServer_pb2.ListFeaturesRequest(project=project_name),
95+
RegistryServer_pb2.ListFeaturesRequest(
96+
project=project_name, allow_cache=allow_cache
97+
),
8998
)
9099
except Exception:
91100
features = {"features": []}
92101
try:
93102
feature_views = grpc_call(
94103
grpc_handler.ListFeatureViews,
95-
RegistryServer_pb2.ListFeatureViewsRequest(project=project_name),
104+
RegistryServer_pb2.ListFeatureViewsRequest(
105+
project=project_name, allow_cache=allow_cache
106+
),
96107
)
97108
except Exception:
98109
feature_views = {"featureViews": []}
99110
try:
100111
feature_services = grpc_call(
101112
grpc_handler.ListFeatureServices,
102-
RegistryServer_pb2.ListFeatureServicesRequest(project=project_name),
113+
RegistryServer_pb2.ListFeatureServicesRequest(
114+
project=project_name, allow_cache=allow_cache
115+
),
103116
)
104117
except Exception:
105118
feature_services = {"featureServices": []}
@@ -118,7 +131,8 @@ def count_resources_for_project(project_name: str):
118131
else:
119132
# List all projects via gRPC
120133
projects_resp = grpc_call(
121-
grpc_handler.ListProjects, RegistryServer_pb2.ListProjectsRequest()
134+
grpc_handler.ListProjects,
135+
RegistryServer_pb2.ListProjectsRequest(allow_cache=allow_cache),
122136
)
123137
all_projects = [
124138
p["spec"]["name"] for p in projects_resp.get("projects", [])

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def list_saved_datasets(
119119
saved_datasets = response.get("savedDatasets", [])
120120

121121
result = {
122-
"saved_datasets": saved_datasets,
122+
"savedDatasets": saved_datasets,
123123
"pagination": response.get("pagination", {}),
124124
}
125125

sdk/python/feast/protos/feast/core/DataFormat_pb2.pyi

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
"""
22
@generated by mypy-protobuf. Do not edit manually!
33
isort:skip_file
4-
5-
Copyright 2020 The Feast Authors
6-
7-
Licensed under the Apache License, Version 2.0 (the "License");
8-
you may not use this file except in compliance with the License.
9-
You may obtain a copy of the License at
10-
11-
https://www.apache.org/licenses/LICENSE-2.0
12-
13-
Unless required by applicable law or agreed to in writing, software
14-
distributed under the License is distributed on an "AS IS" BASIS,
15-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16-
See the License for the specific language governing permissions and
4+
5+
Copyright 2020 The Feast Authors
6+
7+
Licensed under the Apache License, Version 2.0 (the "License");
8+
you may not use this file except in compliance with the License.
9+
You may obtain a copy of the License at
10+
11+
https://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing, software
14+
distributed under the License is distributed on an "AS IS" BASIS,
15+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
See the License for the specific language governing permissions and
1717
limitations under the License.
1818
"""
1919
import builtins
@@ -81,7 +81,7 @@ class StreamFormat(google.protobuf.message.Message):
8181

8282
CLASS_PATH_FIELD_NUMBER: builtins.int
8383
class_path: builtins.str
84-
"""Classpath to the generated Java Protobuf class that can be used to decode
84+
"""Classpath to the generated Java Protobuf class that can be used to decode
8585
Feature data from the obtained stream message
8686
"""
8787
def __init__(
@@ -98,7 +98,7 @@ class StreamFormat(google.protobuf.message.Message):
9898

9999
SCHEMA_JSON_FIELD_NUMBER: builtins.int
100100
schema_json: builtins.str
101-
"""Optional if used in a File DataSource as schema is embedded in avro file.
101+
"""Optional if used in a File DataSource as schema is embedded in avro file.
102102
Specifies the schema of the Avro message as JSON string.
103103
"""
104104
def __init__(

sdk/python/feast/protos/feast/core/DatastoreTable_pb2.pyi

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
"""
22
@generated by mypy-protobuf. Do not edit manually!
33
isort:skip_file
4-
5-
* Copyright 2021 The Feast Authors
6-
*
7-
* Licensed under the Apache License, Version 2.0 (the "License");
8-
* you may not use this file except in compliance with the License.
9-
* You may obtain a copy of the License at
10-
*
11-
* https://www.apache.org/licenses/LICENSE-2.0
12-
*
13-
* Unless required by applicable law or agreed to in writing, software
14-
* distributed under the License is distributed on an "AS IS" BASIS,
15-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16-
* See the License for the specific language governing permissions and
4+
5+
* Copyright 2021 The Feast Authors
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* https://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
1717
* limitations under the License.
1818
"""
1919
import builtins

sdk/python/feast/protos/feast/core/Entity_pb2.pyi

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
"""
22
@generated by mypy-protobuf. Do not edit manually!
33
isort:skip_file
4-
5-
* Copyright 2020 The Feast Authors
6-
*
7-
* Licensed under the Apache License, Version 2.0 (the "License");
8-
* you may not use this file except in compliance with the License.
9-
* You may obtain a copy of the License at
10-
*
11-
* https://www.apache.org/licenses/LICENSE-2.0
12-
*
13-
* Unless required by applicable law or agreed to in writing, software
14-
* distributed under the License is distributed on an "AS IS" BASIS,
15-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16-
* See the License for the specific language governing permissions and
4+
5+
* Copyright 2020 The Feast Authors
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* https://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
1717
* limitations under the License.
1818
"""
1919
import builtins

sdk/python/feast/protos/feast/core/FeatureViewProjection_pb2.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ else:
1919
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
2020

2121
class FeatureViewProjection(google.protobuf.message.Message):
22-
"""A projection to be applied on top of a FeatureView.
22+
"""A projection to be applied on top of a FeatureView.
2323
Contains the modifications to a FeatureView such as the features subset to use.
2424
"""
2525

sdk/python/feast/protos/feast/core/OnDemandFeatureView_pb2.pyi

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
"""
22
@generated by mypy-protobuf. Do not edit manually!
33
isort:skip_file
4-
5-
Copyright 2020 The Feast Authors
6-
7-
Licensed under the Apache License, Version 2.0 (the "License");
8-
you may not use this file except in compliance with the License.
9-
You may obtain a copy of the License at
10-
11-
https://www.apache.org/licenses/LICENSE-2.0
12-
13-
Unless required by applicable law or agreed to in writing, software
14-
distributed under the License is distributed on an "AS IS" BASIS,
15-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16-
See the License for the specific language governing permissions and
4+
5+
Copyright 2020 The Feast Authors
6+
7+
Licensed under the Apache License, Version 2.0 (the "License");
8+
you may not use this file except in compliance with the License.
9+
You may obtain a copy of the License at
10+
11+
https://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing, software
14+
distributed under the License is distributed on an "AS IS" BASIS,
15+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
See the License for the specific language governing permissions and
1717
limitations under the License.
1818
"""
1919
import builtins

sdk/python/feast/protos/feast/core/Project_pb2.pyi

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
"""
22
@generated by mypy-protobuf. Do not edit manually!
33
isort:skip_file
4-
5-
* Copyright 2020 The Feast Authors
6-
*
7-
* Licensed under the Apache License, Version 2.0 (the "License");
8-
* you may not use this file except in compliance with the License.
9-
* You may obtain a copy of the License at
10-
*
11-
* https://www.apache.org/licenses/LICENSE-2.0
12-
*
13-
* Unless required by applicable law or agreed to in writing, software
14-
* distributed under the License is distributed on an "AS IS" BASIS,
15-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16-
* See the License for the specific language governing permissions and
4+
5+
* Copyright 2020 The Feast Authors
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* https://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
1717
* limitations under the License.
1818
"""
1919
import builtins

0 commit comments

Comments
 (0)