Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up keys in redis cache created by tests to improve performance #1100

Merged
merged 2 commits into from
Feb 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions feathr_project/test/test_azure_snowflake_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def test_feathr_online_store_agg_features():
assert res['2'][0] != None
assert res['2'][1] != None

client._clean_test_data(online_test_table)

def test_feathr_get_offline_features():
"""
Expand Down
4 changes: 4 additions & 0 deletions feathr_project/test/test_azure_spark_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ def test_feathr_online_store_agg_features():
['f_location_avg_fare', 'f_location_max_fare'])
assert res['81#254'] != None
assert res['25#42'] != None

client._clean_test_data(online_test_table)

@pytest.mark.skip(reason="Add back when complex types are supported in python API")
def test_feathr_online_store_non_agg_features():
Expand Down Expand Up @@ -142,6 +144,8 @@ def test_feathr_online_store_non_agg_features():
_validate_constant_feature(res['265'])
assert res['265'][0] != None
assert res['265'][1] != None

client._clean_test_data(online_test_table)


def _validate_constant_feature(feature):
Expand Down
3 changes: 3 additions & 0 deletions feathr_project/test/test_feature_materialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ def test_materialize_features_verbose():
"f_location_avg_fare", "f_location_max_fare"],
backfill_time=backfill_time)
client.materialize_features(settings, verbose=True)
client._clean_test_data(online_test_table)

def add_new_fare_amount(df: DataFrame) -> DataFrame:
df = df.withColumn("fare_amount_new", col("fare_amount") + 8000000)
Expand Down Expand Up @@ -363,6 +364,8 @@ def test_delete_feature_from_redis():

assert len(res) == 1
assert res[0] == None

client._clean_test_data(online_test_table)

def test_feature_list_on_input_context():
with pytest.raises(RuntimeError) as e_info:
Expand Down
4 changes: 4 additions & 0 deletions feathr_project/test/test_pyduf_preprocessing_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ def test_non_swa_feature_gen_with_offline_preprocessing():
res = client.get_online_features(online_test_table, '2020-04-01 07:21:51', [
'f_is_long_trip_distance', 'f_day_of_week'])
assert res == [8000006.0, 4]

client._clean_test_data(online_test_table)


def test_feature_swa_feature_gen_with_preprocessing():
Expand Down Expand Up @@ -171,6 +173,8 @@ def test_feature_swa_feature_gen_with_preprocessing():

res = client.get_online_features(online_test_table, '265', ['f_location_avg_fare', 'f_location_max_fare'])
assert res == [1000041.625, 1000100.0]

client._clean_test_data(online_test_table)


def test_feathr_get_offline_features_hdfs_source():
Expand Down