Skip to content

Commit d66c931

Browse files
fix: Switch from join_key to join_keys in tests and docs (#2580)
* Switch from `join_key` to `join_keys` in tests and docs Signed-off-by: Felix Wang <[email protected]> * Convert iterator to list so it can be used repeatedly Signed-off-by: Felix Wang <[email protected]> * Format Signed-off-by: Felix Wang <[email protected]>
1 parent f372981 commit d66c931

File tree

16 files changed

+35
-31
lines changed

16 files changed

+35
-31
lines changed

docs/getting-started/concepts/entity.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
An entity is a collection of semantically related features. Users define entities to map to the domain of their use case. For example, a ride-hailing service could have customers and drivers as their entities, which group related features that correspond to these customers and drivers.
44

55
```python
6-
driver = Entity(name='driver', value_type=ValueType.STRING, join_key='driver_id')
6+
driver = Entity(name='driver', value_type=ValueType.STRING, join_keys=['driver_id'])
77
```
88

99
Entities are typically defined as part of feature views. Entity name is used to reference the entity from a feature view definition and join key is used to identify the physical primary key on which feature values should be stored and retrieved. These keys are used during the lookup of feature values from the online store and the join process in point-in-time joins. It is possible to define composite entities \(more than one entity object\) in a feature view. It is also possible for feature views to have zero entities. See [feature view](feature-view.md) for more details.

docs/getting-started/concepts/feature-view.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ It is suggested that you dynamically specify the new FeatureView name using `.wi
7979
from feast import BigQuerySource, Entity, FeatureView, Field, ValueType
8080
from feast.types import Int32
8181

82-
location = Entity(name="location", join_key="location_id", value_type=ValueType.INT64)
82+
location = Entity(name="location", join_keys=["location_id"], value_type=ValueType.INT64)
8383

8484
location_stats_fv= FeatureView(
8585
name="location_stats",

docs/getting-started/quickstart.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ driver_hourly_stats = FileSource(
9898
# fetch features.
9999
# Entity has a name used for later reference (in a feature view, eg)
100100
# and join_key to identify physical field name used in storages
101-
driver = Entity(name="driver", value_type=ValueType.INT64, join_key="driver_id", description="driver id",)
101+
driver = Entity(name="driver", value_type=ValueType.INT64, join_keys=["driver_id"], description="driver id",)
102102

103103
# Our parquet files contain sample data that includes a driver_id column, timestamps and
104104
# three feature column. Here we define a Feature View that will allow us to serve this
@@ -168,7 +168,7 @@ driver_hourly_stats = FileSource(
168168
# fetch features.
169169
# Entity has a name used for later reference (in a feature view, eg)
170170
# and join_key to identify physical field name used in storages
171-
driver = Entity(name="driver", value_type=ValueType.INT64, join_key="driver_id", description="driver id",)
171+
driver = Entity(name="driver", value_type=ValueType.INT64, join_keys=["driver_id"], description="driver id",)
172172

173173
# Our parquet files contain sample data that includes a driver_id column, timestamps and
174174
# three feature column. Here we define a Feature View that will allow us to serve this

docs/tutorials/validating-historical-features.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ batch_source = FileSource(
129129

130130

131131
```python
132-
taxi_entity = Entity(name='taxi', join_key='taxi_id')
132+
taxi_entity = Entity(name='taxi', join_keys=['taxi_id'])
133133
```
134134

135135

sdk/python/feast/feature_view.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
DUMMY_ENTITY_NAME = "__dummy"
4646
DUMMY_ENTITY_VAL = ""
4747
DUMMY_ENTITY = Entity(
48-
name=DUMMY_ENTITY_NAME, join_key=DUMMY_ENTITY_ID, value_type=ValueType.STRING,
48+
name=DUMMY_ENTITY_NAME, join_keys=[DUMMY_ENTITY_ID], value_type=ValueType.STRING,
4949
)
5050

5151

sdk/python/feast/inference.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ def update_entities_with_inferred_types_from_feature_views(
3232
if not (incomplete_entities_keys & set(view.entities)):
3333
continue # skip if view doesn't contain any entities that need inference
3434

35-
col_names_and_types = view.batch_source.get_table_column_names_and_types(config)
35+
col_names_and_types = list(
36+
view.batch_source.get_table_column_names_and_types(config)
37+
)
3638
for entity_name in view.entities:
3739
if entity_name in incomplete_entities:
3840
entity = incomplete_entities[entity_name]

sdk/python/feast/templates/aws/driver_repo.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
driver = Entity(
1010
# Name of the entity. Must be unique within a project
1111
name="driver",
12-
# The join key of an entity describes the storage level field/column on which
13-
# features can be looked up. The join key is also used to join feature
12+
# The join keys of an entity describe the storage level field/column on which
13+
# features can be looked up. The join keys are also used to join feature
1414
# tables/views when building feature vectors
15-
join_key="driver_id",
15+
join_keys=["driver_id"],
1616
# The storage level type for an entity
1717
value_type=ValueType.INT64,
1818
)

sdk/python/feast/templates/gcp/driver_repo.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
driver = Entity(
1010
# Name of the entity. Must be unique within a project
1111
name="driver",
12-
# The join key of an entity describes the storage level field/column on which
13-
# features can be looked up. The join key is also used to join feature
12+
# The join keys of an entity describe the storage level field/column on which
13+
# features can be looked up. The join keys are also used to join feature
1414
# tables/views when building feature vectors
15-
join_key="driver_id",
15+
join_keys=["driver_id"],
1616
# The storage level type for an entity
1717
value_type=ValueType.INT64,
1818
)

sdk/python/feast/templates/local/example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
# Define an entity for the driver. You can think of entity as a primary key used to
1818
# fetch features.
19-
driver = Entity(name="driver", join_key="driver_id", value_type=ValueType.INT64,)
19+
driver = Entity(name="driver", join_keys=["driver_id"], value_type=ValueType.INT64,)
2020

2121
# Our parquet files contain sample data that includes a driver_id column, timestamps and
2222
# three feature column. Here we define a Feature View that will allow us to serve this

sdk/python/feast/templates/snowflake/driver_repo.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
driver = Entity(
1212
# Name of the entity. Must be unique within a project
1313
name="driver",
14-
# The join key of an entity describes the storage level field/column on which
15-
# features can be looked up. The join key is also used to join feature
14+
# The join keys of an entity describe the storage level field/column on which
15+
# features can be looked up. The join keys are also used to join feature
1616
# tables/views when building feature vectors
17-
join_key="driver_id",
17+
join_keys=["driver_id"],
1818
)
1919

2020
# Indicates a data source from which feature values can be retrieved. Sources are queried when building training

0 commit comments

Comments
 (0)