Skip to content

Commit

Permalink
Clean up redis keys created by CI tests (#1100)
Browse files Browse the repository at this point in the history
  • Loading branch information
enya-yx authored Feb 28, 2023
1 parent 828e71c commit e011537
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
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

0 comments on commit e011537

Please sign in to comment.