[bug] No keyword "featuregroup" for get_features

There are no argument to pass Feature Group name into get_features() to get multiple feature, in case of duplicate feature name across Feature Group.


Here I have 2 feature group (“iris” and “iris_id_only”) with same name feature “id”.

I tried to get feature “id” and “sepalwidthcm”

df_get_id = featurestore.get_features(["id", "sepalwidthcm"])

I get error:

An error was encountered:
Found the feature with name 'id' in more than one of the featuregroups of the featurestore: 'mewo_project_featurestore', please specify the optional argument 'featuregroup=', the matched featuregroups were: iris_1,iris_id_only_1
Traceback (most recent call last):
  File "/srv/hops/anaconda/envs/theenv/lib/python3.6/site-packages/hops/featurestore.py", line 368, in get_features
    online=online)
  File "/srv/hops/anaconda/envs/theenv/lib/python3.6/site-packages/hops/featurestore_impl/core.py", line 613, in _do_get_features
    logical_query_plan.create_logical_plan()
  File "/srv/hops/anaconda/envs/theenv/lib/python3.6/site-packages/hops/featurestore_impl/query_planner/logical_query_plan.py", line 32, in create_logical_plan
    self._features_query()
  File "/srv/hops/anaconda/envs/theenv/lib/python3.6/site-packages/hops/featurestore_impl/query_planner/logical_query_plan.py", line 145, in _features_query
    featuregroups_parsed.values())
  File "/srv/hops/anaconda/envs/theenv/lib/python3.6/site-packages/hops/featurestore_impl/query_planner/query_planner.py", line 64, in _find_feature
    featuregroups_matched_str))
hops.featurestore_impl.exceptions.exceptions.FeatureNameCollisionError: Found the feature with name 'id' in more than one of the featuregroups of the featurestore: 'mewo_project_featurestore', please specify the optional argument 'featuregroup=', the matched featuregroups were: iris_1,iris_id_only_1

The error said I need argument featuregroup because there are feature name id in multiple feature_group. However, when input with featuregroup

df_get_id = featurestore.get_features(["id", "sepalwidthcm"], featuregroup="iris")

get_features don’t have featuregroup

An error was encountered:
get_features() got an unexpected keyword argument 'featuregroup'
Traceback (most recent call last):
TypeError: get_features() got an unexpected keyword argument 'featuregroup'

Calling get_feature single feature each time is not convenient because I have to do the joining manually. If I cannot get id with another feature, how I am suppose to do the joinning ?

Happen on demo cluster version 1.4

1 Like

Hi @thaithien,

We have been working on solving the joining issues on the hops library.
We wrote a new library called hsfs (https://github.com/logicalclocks/feature-store-api) - In 1.4 it’s still in beta, however you can try the joining capabilities already.

The joining APIs for the hsfs library are similar to Pandas dataframe merge operations and allow for more precision when joining. You can have a look at some examples here (https://github.com/logicalclocks/hops-examples/tree/master/notebooks/featurestore/hsfs), in particular this notebook (https://github.com/logicalclocks/hops-examples/blob/master/notebooks/featurestore/hsfs/feature_exploration.ipynb)

You can also have a look at the documentation for the library here: https://docs.hopsworks.ai/