You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I call the get_online_features_async method on the FeatureStore.
I am passing an "entity value" that is not materialized in the online store. For example, only driver_id1 and 2 are materialized in the online store. However, I’m passing 99999.
I’m using an OnDemandFeatureView.
Expected Behavior
When only points 1 and 2 are true, I get a response that has None values for all the features. This functionality works as expected.
When all three points are true, I would also expect to get a response that has None values for all the features. However, this is not the case.
Current Behavior
When only points 1 and 2 are true, I get a response that has None values for all the features. This functionality works as expected.
I would expect this to be true as well when using OnDemandFeatureViews (ODFVs). However, when all three points are true, the following error is raised: TypeError: Couldn't infer value type from empty value.
Steps to Reproduce
This branch contains an additional integration test named test_async_online_retrieval_with_event_timestamps_null_only, which acts as a minimal failing example.
The error is raised when the python_values_to_proto_valuesmethod is called in the sdk/python/feast/utils.py file, which is invoked by the get_online_features_asyncmethod in the sdk/python/feast/infra/online_stores/online_store.py file (these locations are marked with # breakpoint() in the linked branch).
Furthermore, this error is only happening when we are "only" passing unknown entity values. For example, if we are only passing the unknown entity value 99999, it will fail. If we pass the known entity value 1 and the unknown value 99999, it will be successful.
You can run this test by creating a virtual environment, and run this command in the shell:
importpandasaspdfromfeastimportFeatureStorefeature_store=FeatureStore()
feature_service_pandas=feature_store.get_feature_service(
name="features_feature_service_pandas"
)
feature_service_python=feature_store.get_feature_service(
name="features_feature_service_python"
)
entity_rows= [
# This entity ID is not in the offline or online store
{"ENTITY_ID": "1", "REQUEST_FLOAT": 1.0},
]
entity_df=pd.DataFrame(entity_rows)
entity_df["event_timestamp"] =pd.to_datetime("now", utc=True)
# This works.print("offline with pandas")
offline_features=feature_store.get_historical_features(
entity_df=entity_df,
features=feature_service_pandas,
).to_df()
print(list(offline_features.to_dict().keys()))
## This doesn't work, raises the error# print("online with pandas")# online_features = feature_store.get_online_features(# entity_rows=entity_rows,# features=feature_service_pandas,# ).to_dict()# print(list(online_features.keys()))## This doesn't work, raises the error# print("online with python")# online_features = feature_store.get_online_features(# entity_rows=entity_rows,# features=feature_service_python,# ).to_dict()# print(list(online_features.keys()))
Specifications
Version: 0.36.0
Platform: macOS - M1
Subsystem: Sonoma 14.1.1
Possible Solution
I’m not entirely sure why ValueType.UNKNOWN is passed to the feature_type argument of the python_values_to_proto_values method. If we were to pass another value, I believe the method would succeed, as the if statement that raises the error would not be triggered.
The text was updated successfully, but these errors were encountered:
Context
Factors to Consider
get_online_features_async
method on theFeatureStore
.driver_id
1
and2
are materialized in the online store. However, I’m passing99999
.OnDemandFeatureView
.Expected Behavior
When only points 1 and 2 are true, I get a response that has
None
values for all the features. This functionality works as expected.When all three points are true, I would also expect to get a response that has
None
values for all the features. However, this is not the case.Current Behavior
When only points 1 and 2 are true, I get a response that has
None
values for all the features. This functionality works as expected.I would expect this to be true as well when using
OnDemandFeatureViews
(ODFVs). However, when all three points are true, the following error is raised:TypeError: Couldn't infer value type from empty value
.Steps to Reproduce
This branch contains an additional integration test named
test_async_online_retrieval_with_event_timestamps_null_only
, which acts as a minimal failing example.The error is raised when the
python_values_to_proto_values
method is called in thesdk/python/feast/utils.py
file, which is invoked by theget_online_features_async
method in thesdk/python/feast/infra/online_stores/online_store.py
file (these locations are marked with# breakpoint()
in the linked branch).Furthermore, this error is only happening when we are "only" passing unknown entity values. For example, if we are only passing the unknown entity value 99999, it will fail. If we pass the known entity value 1 and the unknown value 99999, it will be successful.
You can run this test by creating a virtual environment, and run this command in the shell:
PYTHONPATH='.' \ FULL_REPO_CONFIGS_MODULE=sdk.python.feast.infra.online_stores.contrib.postgres_repo_configuration \ PYTEST_PLUGINS=sdk.python.tests.integration.feature_repos.universal.online_store.postgres \ python -m pytest --integration sdk/python/tests/integration/online_store/test_universal_online.py::test_async_online_retrieval_with_event_timestamps_null_only
Another method to re-produce:
docker-compose.yml
feature_store.yml
Insert into offline store (postgres)
postgres_init/create-offline-store-database.sql
bootstrap.py
materialize
inference
Specifications
Possible Solution
I’m not entirely sure why
ValueType.UNKNOWN
is passed to thefeature_type
argument of thepython_values_to_proto_values
method. If we were to pass another value, I believe the method would succeed, as theif
statement that raises the error would not be triggered.The text was updated successfully, but these errors were encountered: