From 791d4fbac5f8e8a43a8415964a6e538947f21136 Mon Sep 17 00:00:00 2001 From: Karl Higley Date: Thu, 14 Jul 2022 14:32:25 -0400 Subject: [PATCH] Add a more helpful error message to Feast operator (#142) * Add a more helpful error message to Feast operator * Split long line in error message --- merlin/systems/dag/ops/feast.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/merlin/systems/dag/ops/feast.py b/merlin/systems/dag/ops/feast.py index ef41bdb54..bc37f16a2 100644 --- a/merlin/systems/dag/ops/feast.py +++ b/merlin/systems/dag/ops/feast.py @@ -275,6 +275,12 @@ def transform(self, df: InferenceDataFrame) -> InferenceDataFrame: Transformed tensor dictionary """ entity_ids = df[self.entity_column] + + if len(entity_ids) < 1: + raise ValueError( + "No entity ids provided when querying Feast. Must provide " + "at least one id in order to fetch features." + ) entity_rows = [{self.entity_id: int(entity_id)} for entity_id in entity_ids] feature_names = self.features + self.mh_features