From 5fea569f669c7abe5f44d6c711f9acb70a70b5a1 Mon Sep 17 00:00:00 2001 From: Matt Delacour Date: Thu, 14 Oct 2021 14:55:02 -0400 Subject: [PATCH] Remove teardown logic in tests as it s part of conftest Signed-off-by: Matt Delacour --- .../test_universal_historical_retrieval.py | 45 +++++++++---------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/sdk/python/tests/integration/offline_store/test_universal_historical_retrieval.py b/sdk/python/tests/integration/offline_store/test_universal_historical_retrieval.py index cde95f0e07..4b17095131 100644 --- a/sdk/python/tests/integration/offline_store/test_universal_historical_retrieval.py +++ b/sdk/python/tests/integration/offline_store/test_universal_historical_retrieval.py @@ -563,34 +563,29 @@ def test_historical_features_from_bigquery_sources_containing_backfills(environm store.apply([driver, driver_fv]) - try: - offline_job = store.get_historical_features( - entity_df=entity_df, - features=["driver_stats:avg_daily_trips"], - full_feature_names=False, - ) - - start_time = datetime.utcnow() - actual_df = offline_job.to_df() + offline_job = store.get_historical_features( + entity_df=entity_df, + features=["driver_stats:avg_daily_trips"], + full_feature_names=False, + ) - print(f"actual_df shape: {actual_df.shape}") - end_time = datetime.utcnow() - print( - str(f"Time to execute job_from_df.to_df() = '{(end_time - start_time)}'\n") - ) + start_time = datetime.utcnow() + actual_df = offline_job.to_df() - assert sorted(expected_df.columns) == sorted(actual_df.columns) - assert_frame_equal( - expected_df.sort_values(by=["driver_id"]).reset_index(drop=True), - actual_df[expected_df.columns] - .sort_values(by=["driver_id"]) - .reset_index(drop=True), - check_dtype=False, - ) + print(f"actual_df shape: {actual_df.shape}") + end_time = datetime.utcnow() + print( + str(f"Time to execute job_from_df.to_df() = '{(end_time - start_time)}'\n") + ) - finally: - store.teardown() - environment.data_source_creator.teardown() + assert sorted(expected_df.columns) == sorted(actual_df.columns) + assert_frame_equal( + expected_df.sort_values(by=["driver_id"]).reset_index(drop=True), + actual_df[expected_df.columns] + .sort_values(by=["driver_id"]) + .reset_index(drop=True), + check_dtype=False, + ) def response_feature_name(feature: str, full_feature_names: bool) -> str: