Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
21e47d2
test
mavysavydav Jun 12, 2021
06e0c77
refactored existing tests to test full_feature_names feature on data …
Mwad22 Jun 16, 2021
4b7dd18
removed full_feature_names usage from quickstart and README to have m…
Mwad22 Jun 16, 2021
579e08f
Update CHANGELOG for Feast v0.10.8
Jun 17, 2021
462da43
GitBook: [master] 2 pages modified
achals Jun 17, 2021
df95ee8
Schema Inferencing should happen at apply time (#1646)
mavysavydav Jun 18, 2021
e383575
GitBook: [master] 80 pages modified
woop Jun 19, 2021
dd25ad6
GitBook: [master] 80 pages modified
woop Jun 20, 2021
cef2869
Provide descriptive error on invalid table reference (#1627)
codyjlin Jun 21, 2021
c2e2b4d
Refactor OnlineStoreConfig classes into owning modules (#1649)
achals Jun 21, 2021
d2cda24
Possibility to specify a project for BigQuery queries (#1656)
MattDelac Jun 21, 2021
4ab4c60
Refactor OfflineStoreConfig classes into their owning modules (#1657)
achals Jun 22, 2021
64a2cb5
Run python unit tests in parallel (#1652)
achals Jun 22, 2021
9e4c907
Rename telemetry to usage (#1660)
Jun 22, 2021
b951282
resolved final comments on PR (variable renaming, refactor tests)
Mwad22 Jun 23, 2021
a68b12b
reformatted after merge conflict
Mwad22 Jun 23, 2021
094dbf3
Update CHANGELOG for Feast v0.11.0
woop Jun 24, 2021
0a148f9
Update charts README (#1659)
szalai1 Jun 25, 2021
0ce8210
Added Redis to list of online stores for local provider in providers …
nels Jun 25, 2021
d71e4c5
Grouped inferencing statements together in apply methods for easier r…
mavysavydav Jun 25, 2021
c14023f
Add RedshiftDataSource (#1669)
Jun 28, 2021
d138648
Provide the user with more options for setting the to_bigquery config…
codyjlin Jun 28, 2021
c02b9eb
Add streaming sources to the FeatureView API (#1664)
achals Jun 28, 2021
12dbbea
Add to_table() to RetrievalJob object (#1663)
MattDelac Jun 29, 2021
d0fe0a9
Rename to_table to to_arrow (#1671)
MattDelac Jun 29, 2021
6e8670e
Cancel BigQuery job if timeout hits (#1672)
MattDelac Jun 29, 2021
5314024
Fix Feature References example (#1674)
GregKuhlmann Jun 30, 2021
eb1da5e
Allow strings for online/offline store instead of dicts (#1673)
achals Jun 30, 2021
183a0b9
Remove default list from the FeatureView constructor (#1679)
achals Jul 1, 2021
b714a12
made changes requested by @tsotnet
Mwad22 Jul 2, 2021
c78894f
Fix unit tests that got broken by Pandas 1.3.0 release (#1683)
Jul 3, 2021
20c9461
Add support for DynamoDB and S3 registry (#1483)
leonid133 Jul 3, 2021
d36d1a0
Parallelize integration tests (#1684)
Jul 4, 2021
651bce3
BQ exception should be raised first before we check the timedout (#1675)
MattDelac Jul 5, 2021
f3b92c3
Update sdk/python/feast/infra/provider.py
Mwad22 Jul 5, 2021
f400d65
Update sdk/python/feast/feature_store.py
Mwad22 Jul 5, 2021
082fca7
made error logic/messages more descriptive
Mwad22 Jul 5, 2021
3aca976
made error logic/messages more descriptive.
Mwad22 Jul 5, 2021
79aa736
Simplified error messages
Mwad22 Jul 6, 2021
d7d08ef
ran formatter, issue in errors.py
Mwad22 Jul 7, 2021
2ab8eea
Merge branch 'master' into mwad22-1618-PR
Mwad22 Jul 7, 2021
650340d
python linter issues resolved
Mwad22 Jul 7, 2021
5d582a6
removed unnecessary default assignment in get_historical_features. de…
Mwad22 Jul 8, 2021
8724e0b
added error message assertion for feature name collisions, and other …
Mwad22 Jul 8, 2021
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
made error logic/messages more descriptive
Signed-off-by: Mwad22 <51929507+Mwad22@users.noreply.github.com>
  • Loading branch information
Mwad22 committed Jul 7, 2021
commit 082fca7169cf2440d82e6fa7fbe7019916214d83
11 changes: 8 additions & 3 deletions sdk/python/feast/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,16 @@ def __init__(self, offline_store_name: str, data_source_name: str):

class FeatureNameCollisionError(Exception):
def __init__(self, feature_refs_collisions: List[str]):
feature_name_collisions = [ref.split(":")[1] for ref in feature_refs_collisions]
feature_names = ", ".join(x for x in feature_name_collisions)
collisions = [ref.split(":", 1) for ref in feature_refs_collisions]
collision_feature_views = [y for (y, _) in collisions]
collision_feature_names = [x for (_, x) in collisions]
feature_names = ", ".join(set(collision_feature_names))
feature_views = ", ".join(set(collision_feature_views))
super().__init__(
f"The following feature name(s) have collisions: {feature_names}. Set 'full_feature_names' "
f"argument in the data retrieval function to True to use the full feature name which is prefixed by the feature view name."
f"argument in the data retrieval function to True to use the full feature name which is prefixed "
f"by the feature view name, or rename colliding features.\nCollisions occur in the following "
f"feature view(s): {feature_views}."
)


Expand Down
19 changes: 13 additions & 6 deletions sdk/python/feast/feature_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,7 @@ def get_online_features(
project=self.project, allow_cache=True
)

_validate_feature_refs(feature_refs, full_feature_names)
grouped_refs = _group_feature_refs(feature_refs, all_feature_views)
for table, requested_features in grouped_refs:
entity_keys = _get_table_entity_keys(
Expand Down Expand Up @@ -613,13 +614,19 @@ def _entity_row_to_field_values(


def _validate_feature_refs(feature_refs: List[str], full_feature_names: bool = False):
Comment thread
Mwad22 marked this conversation as resolved.
Outdated
feature_names = [ref.split(":")[1] for ref in feature_refs]
feature_name, occurrences = Counter(feature_names).most_common(1)[0]
if count > 1:
if full_feature_names:
collided_feature_refs = [
ref for ref in feature_refs if ref.endswith(":" + feature_name)
]
raise FeatureNameCollisionError(collided_feature_refs)
ref for ref, occurrences in Counter(feature_refs).items() if occurrences > 1]
if len(collided_feature_refs) > 0:
raise FeatureNameCollisionError(collided_feature_refs)
else:
feature_names = [ref.split(":")[1] for ref in feature_refs]
feature_name, occurrences = Counter(feature_names).most_common(1)[0]
if occurrences > 1:
collided_feature_refs = [
ref for ref in feature_refs if ref.endswith(":" + feature_name)
]
raise FeatureNameCollisionError(collided_feature_refs)


def _group_feature_refs(
Expand Down
2 changes: 2 additions & 0 deletions sdk/python/feast/infra/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ def get_historical_features(
entity_df: Union[pandas.DataFrame, str],
registry: Registry,
project: str,
full_feature_names: bool = False,
Comment thread
Mwad22 marked this conversation as resolved.
Outdated
) -> RetrievalJob:
job = self.offline_store.get_historical_features(
config=config,
Expand All @@ -137,5 +138,6 @@ def get_historical_features(
entity_df=entity_df,
registry=registry,
project=project,
full_feature_names=full_feature_names,
)
return job
22 changes: 16 additions & 6 deletions sdk/python/tests/test_historical_retrieval.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,22 @@ def get_expected_training_df(
expected_df = expected_df[[event_timestamp] + current_cols]

# Cast some columns to expected types, since we lose information when converting pandas DFs into Python objects.
expected_column_types = {
"order_is_success": "int32",
"driver_stats__conv_rate": "float32",
"customer_profile__current_balance": "float32",
"customer_profile__avg_passenger_count": "float32",
}

if full_feature_names:
expected_column_types = {
"order_is_success": "int32",
"driver_stats__conv_rate": "float32",
"customer_profile__current_balance": "float32",
"customer_profile__avg_passenger_count": "float32",
}
else:
expected_column_types = {
"order_is_success": "int32",
"conv_rate": "float32",
"current_balance": "float32",
"avg_passenger_count": "float32",
}

for col, typ in expected_column_types.items():
expected_df[col] = expected_df[col].astype(typ)

Expand Down
7 changes: 4 additions & 3 deletions sdk/python/tests/test_offline_online_store_consistency.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ def check_offline_and_online_features(
assert abs(df.to_dict()["value"][0] - expected_value) < 1e-6
else:
assert math.isnan(df.to_dict()["value"][0])



def run_offline_online_store_consistency_test(
Expand Down Expand Up @@ -341,13 +340,15 @@ def test_redis_offline_online_store_consistency(full_feature_names: bool):
with prep_redis_fs_and_fv() as (fs, fv):
run_offline_online_store_consistency_test(fs, fv, full_feature_names)


@pytest.mark.parametrize("full_feature_names", [True, False])
@pytest.mark.integration
def test_dynamodb_offline_online_store_consistency(full_feature_names:bool):
def test_dynamodb_offline_online_store_consistency(full_feature_names: bool):
with prep_dynamodb_fs_and_fv() as (fs, fv):
run_offline_online_store_consistency_test(fs, fv, full_feature_names)


@pytest.mark.parametrize("full_feature_names", [True, False])
def test_local_offline_online_store_consistency(full_feature_names:bool):
def test_local_offline_online_store_consistency(full_feature_names: bool):
with prep_local_fs_and_fv() as (fs, fv):
run_offline_online_store_consistency_test(fs, fv, full_feature_names)