Skip to content

Commit 1b59d2f

Browse files
chore: Improve SpecifiedFeaturesNotPresentError error message (feast-dev#2836)
Signed-off-by: Felix Wang <[email protected]>
1 parent 97444e4 commit 1b59d2f

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

sdk/python/feast/errors.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
from colorama import Fore, Style
44

5+
from feast.field import Field
6+
57

68
class DataSourceNotFoundException(Exception):
79
def __init__(self, path):
@@ -183,10 +185,15 @@ def __init__(self, feature_refs_collisions: List[str], full_feature_names: bool)
183185

184186

185187
class SpecifiedFeaturesNotPresentError(Exception):
186-
def __init__(self, specified_features: List[str], feature_view_name: str):
187-
features = ", ".join(specified_features)
188+
def __init__(
189+
self,
190+
specified_features: List[Field],
191+
inferred_features: List[Field],
192+
feature_view_name: str,
193+
):
188194
super().__init__(
189-
f"Explicitly specified features {features} not found in inferred list of features for '{feature_view_name}'"
195+
f"Explicitly specified features {specified_features} not found in inferred list of features "
196+
f"{inferred_features} for '{feature_view_name}'"
190197
)
191198

192199

sdk/python/feast/on_demand_feature_view.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ def infer_features(self):
479479
missing_features.append(specified_features)
480480
if missing_features:
481481
raise SpecifiedFeaturesNotPresentError(
482-
[f.name for f in missing_features], self.name
482+
missing_features, inferred_features, self.name
483483
)
484484
else:
485485
self.features = inferred_features

0 commit comments

Comments
 (0)