feast icon indicating copy to clipboard operation
feast copied to clipboard

Push api call to a push source that doesn't exist returns 200

Open robhowley opened this issue 3 years ago • 1 comments

Expected Behavior

When we POST to a push source that doesn't exist like so

curl -X POST "http://localhost:6566/push" -d '{
    "push_source_name": "push_source_name_that_does_not_exist",
    "df": {
            "some_entity": [1001],
            "event_timestamp": ["2022-05-13 10:59:42"],
            "created": ["2022-05-13 10:59:42"],
            ...
    },
    "to": "online_and_offline",
  }' | jq

I'd expect an error. It is a valid format to the correct endpoint, but is an entity that doesn't exist. A 422 unprocessable entity error would probably make sense here.

Current Behavior

Method FeatureStore().push receives a push_source_name indicating which feature views are impacted by the new data being pushed. The set of feature views is filtered down here. If a push source name is provided that doesn't actually exist then the resulting set is empty, the loop is skipped and the function is a no-op. This successful return means that the /push call in feature_server.py never throws to return an error code.

Steps to reproduce

  • start a local feature server
  • make a push call to a push source that does not exist

Specifications

  • Version:
  • Platform:
  • Subsystem:

Possible Solution

  • Raise a custom exception when no push source is found with the provided name
  • Catch that exception in the feature server
  • Return 422 in that case

If this is considered reasonable, I'm happy to make the contribution myself.

robhowley avatar Sep 13 '22 20:09 robhowley

That generally seems fine. Ideally you'd give a detailed error message as well explaining why it failed too, but sgtm!

adchia avatar Sep 14 '22 16:09 adchia