Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
39733b2
Switch `entities` from List[str] to List[Entity]
felixwang9817 Apr 25, 2022
a6a675b
Remove `value_type` from SDK
felixwang9817 Apr 26, 2022
10523c7
Remove `value_type` from tests
felixwang9817 Apr 26, 2022
705e952
Deprecate `value_type` parameter for Entity
felixwang9817 May 2, 2022
afbb5dd
Add fields for entities to avoid type inference after removing `value…
felixwang9817 Apr 26, 2022
c66976c
Fix Go
felixwang9817 May 2, 2022
00bb4d8
Fix type inference
felixwang9817 May 3, 2022
bc88d5c
Another fix
felixwang9817 May 3, 2022
a4d8e44
Another fix
felixwang9817 May 3, 2022
3dfa9d6
Rename Entities to EntityNames in go
felixwang9817 May 3, 2022
49b01b4
Rename lookup
felixwang9817 May 3, 2022
ac31bb7
Rename Feature to Field
felixwang9817 May 3, 2022
a2158e7
Clean up inference
felixwang9817 May 3, 2022
aad0805
Refactor
felixwang9817 May 3, 2022
21d7e55
Use old `value_type` attribute if it still exists
felixwang9817 May 3, 2022
dc750e8
Refactor
felixwang9817 May 3, 2022
6432029
Add TODO
felixwang9817 May 4, 2022
9808789
Another fix
felixwang9817 May 11, 2022
6c92dc2
Fix test
felixwang9817 May 11, 2022
2be1e40
Add pytest.ini file to suppress pytest warnings about markers
felixwang9817 May 11, 2022
9b341b7
Fix type test
felixwang9817 May 11, 2022
2ed0384
Fix type test
felixwang9817 May 13, 2022
7c5b80d
Modify entity and feature inference to occur separately and add tests
felixwang9817 May 13, 2022
0f129d3
Lint
felixwang9817 May 13, 2022
18fbb0d
Refactor inference to pass lint
felixwang9817 May 13, 2022
7a32b01
Fix Java
felixwang9817 May 13, 2022
6c4e9d6
Another fix
felixwang9817 May 13, 2022
d23ee23
Fix ODFV repo
felixwang9817 May 17, 2022
8eaa65c
Switch deprecation version from 0.22 to 0.23
felixwang9817 May 18, 2022
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
Use old value_type attribute if it still exists
Signed-off-by: Felix Wang <wangfelix98@gmail.com>
  • Loading branch information
felixwang9817 committed May 17, 2022
commit 21d7e55c70a99b50e19f7dbc2b24d4370730a229
1 change: 1 addition & 0 deletions sdk/python/feast/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ def to_proto(self) -> EntityProto:

spec = EntitySpecProto(
name=self.name,
value_type=self.value_type.value,
join_key=self.join_key,
description=self.description,
tags=self.tags,
Expand Down
1 change: 0 additions & 1 deletion sdk/python/feast/feature_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ def __init__(
# here. Conversely, if the user is still using a List[str], they must not have added
# added entity fields, in which case we can set the `features` attribute directly
# equal to the schema.
# TODO(felixwang9817): Use old value_type if it exists.
_features: List[Field] = []
self.entity_columns = []
if _entities and len(_entities) > 0 and isinstance(_entities[0], str):
Expand Down
19 changes: 18 additions & 1 deletion sdk/python/feast/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from feast.field import Field, from_value_type
from feast.repo_config import RepoConfig
from feast.types import String
from feast.value_type import ValueType


def update_data_sources_with_inferred_event_timestamp_col(
Expand Down Expand Up @@ -96,6 +97,7 @@ def update_feature_views_with_inferred_features_and_entities(
entities: A list containing entities associated with the feature views.
config: The config for the current feature store.
"""
entity_name_to_entity_map = {e.name: e for e in entities}
entity_name_to_join_keys_map = {e.name: e.join_keys for e in entities}
all_join_keys = [
join_key
Expand All @@ -117,10 +119,25 @@ def update_feature_views_with_inferred_features_and_entities(
if field.name not in [feature.name for feature in fv.features]:
fv.features.append(field)

# Since the `value_type` parameter has not yet been fully deprecated for
# entities, we respect the `value_type` attribute if it still exists.
for entity_name in fv.entities:
entity = entity_name_to_entity_map[entity_name]
if (
entity_name
not in [entity_column.name for entity_column in fv.entity_columns]
and entity.value_type != ValueType.UNKNOWN
):
entity_column.append(
Field(
name=entity.join_key, dtype=from_value_type(entity.value_type),
)
)

# Handle EFV separately here. Specifically, that means if we have an EFV,
# we need to add a field to entity_columns.
if len(fv.entities) == 1 and fv.entities[0] == DUMMY_ENTITY_NAME:
fv.entity_columns.append(Field(name=DUMMY_ENTITY_ID, dtype=String,))
fv.entity_columns.append(Field(name=DUMMY_ENTITY_ID, dtype=String))

# Run inference if either (a) there are fewer entity fields than expected or
# (b) there are no feature fields.
Expand Down