From 99ba59a66a8fb07a8fd99d18c77ee6af496490b2 Mon Sep 17 00:00:00 2001 From: Satwant Rana Date: Mon, 7 Oct 2024 12:51:15 +0530 Subject: [PATCH] Remove 1us deduction from deletes in latest --- examples/fraud/tests/test_driver_payment_features.py | 2 +- fennel/testing/test_data_engine.py | 6 +++--- fennel/testing/test_utils.py | 4 +--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/examples/fraud/tests/test_driver_payment_features.py b/examples/fraud/tests/test_driver_payment_features.py index 34a224bcb..79db5801f 100644 --- a/examples/fraud/tests/test_driver_payment_features.py +++ b/examples/fraud/tests/test_driver_payment_features.py @@ -153,7 +153,7 @@ def test_min_max_radar_score(client): assert log_response.status_code == 200, log_response.json() df = client.get_dataset_df("TransactionsDS") - assert df.shape[0] == 327 + assert df.shape[0] == 165 @mock diff --git a/fennel/testing/test_data_engine.py b/fennel/testing/test_data_engine.py index 5b9b9d80e..cd95cd38a 100644 --- a/fennel/testing/test_data_engine.py +++ b/fennel/testing/test_data_engine.py @@ -60,13 +60,13 @@ def test_add_delete_timestamps(client): assert deleted_rows.shape[0] == 3 assert internal_df.loc[0, FENNEL_DELETE_TIMESTAMP] == pd.Timestamp( "2021-01-04 00:00:00+0000", tz="UTC" - ) - pd.Timedelta("1us") + ) assert internal_df.loc[1, FENNEL_DELETE_TIMESTAMP] == pd.Timestamp( "2021-01-06 00:00:00+0000", tz="UTC" - ) - pd.Timedelta("1us") + ) assert internal_df.loc[3, FENNEL_DELETE_TIMESTAMP] == pd.Timestamp( "2021-01-05 00:00:00+0000", tz="UTC" - ) - pd.Timedelta("1us") + ) client.commit(datasets=[UnkeyedTestDataset], message="Add data") log(UnkeyedTestDataset, df) diff --git a/fennel/testing/test_utils.py b/fennel/testing/test_utils.py index 43cda0e86..2d7d35a8d 100644 --- a/fennel/testing/test_utils.py +++ b/fennel/testing/test_utils.py @@ -376,9 +376,7 @@ def add_deletes( last_index_for_key[key] = i continue # Add the timestamp of the current row as the delete timestamp for the last row - # Subtract 1 microsecond to ensure that the delete timestamp is strictly less than the - # timestamp of the next row - del_ts = row[ts_col] - pd.Timedelta("1us") + del_ts = row[ts_col] delete_timestamps[last_index] = del_ts last_index_for_key[key] = i