Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
removed print statement and OnlineResponseRow
Signed-off-by: Francisco Javier Arceo <franciscojavierarceo@users.noreply.github.com>
  • Loading branch information
franciscojavierarceo committed Mar 28, 2024
commit 75a30231005843be5fe4c2c8e6cf6fee12bbb879
2 changes: 0 additions & 2 deletions sdk/python/feast/feature_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -2115,12 +2115,10 @@ def _augment_response_with_on_demand_transforms(
elif odfv.mode in {"pandas", "substrait"}:
if initial_response_df is None:
initial_response_df = initial_response.to_df()
print("about to happen\n", initial_response_df)
transformed_features_df: pd.DataFrame = odfv.get_transformed_features(
initial_response_df,
full_feature_names,
)
print("it did not happen")
else:
raise Exception(
f"Invalid OnDemandFeatureMode: {odfv.mode}. Expected one of 'pandas', 'python', or 'substrait'."
Expand Down
42 changes: 0 additions & 42 deletions sdk/python/feast/online_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,45 +78,3 @@ def to_df(self, include_event_timestamps: bool = False) -> pd.DataFrame:

return pd.DataFrame(self.to_dict(include_event_timestamps))


class OnlineResponseRow(OnlineResponse):
def to_dict(self, include_event_timestamps: bool = False) -> Dict[str, Any]:
"""
Converts GetOnlineFeaturesResponse features into a dictionary form.
Args:
is_with_event_timestamps: bool Optionally include feature timestamps in the dictionary
"""
response: Dict[str, Any] = {}

for feature_ref, feature_vector in zip(
self.proto.metadata.feature_names.val, self.proto.results
):

if (
len(feature_vector.values) != 1
or len(feature_vector.event_timestamps) != 1
):
raise ValueError(
f"Response contains more than one row: \n"
f"feature_ref: {feature_ref}"
f"feature_vector: {feature_vector.values},"
f"event_timestamps: {feature_vector.event_timestamps}"
)

response[feature_ref] = feast_value_type_to_python_type(
feature_vector.values[0]
)

if include_event_timestamps:
timestamp_ref = feature_ref + TIMESTAMP_POSTFIX
response[timestamp_ref] = feature_vector.event_timestamps[0].seconds
return response

def to_df(self, include_event_timestamps: bool = False) -> pd.DataFrame:
"""
Converts GetOnlineFeaturesResponse features into Panda dataframe form.
Args:
is_with_event_timestamps: bool Optionally include feature timestamps in the dataframe
"""

return pd.DataFrame([self.to_dict(include_event_timestamps)])