From a2ea96b35e5e8cb980c7149e22d246bba78db85e Mon Sep 17 00:00:00 2001 From: Neeraj Kashyap Date: Fri, 8 Oct 2021 05:36:25 -0700 Subject: [PATCH] Made filters inclusive of start and end times This was a bug that I introduced in my review of @Andrei-Dolgolev's changes. --- datasets/nfts/nfts/datastore.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/datasets/nfts/nfts/datastore.py b/datasets/nfts/nfts/datastore.py index e78ce9ae..0f3f361e 100644 --- a/datasets/nfts/nfts/datastore.py +++ b/datasets/nfts/nfts/datastore.py @@ -445,20 +445,20 @@ def filter_data( """ cur = sqlite_db.cursor() - print(f"Remove by timestamp <= {start_time}") + print(f"Remove by timestamp < {start_time}") if start_time: - cur.execute(f"DELETE from transfers where timestamp <= {start_time}") + cur.execute(f"DELETE from transfers where timestamp < {start_time}") print(f"Transfers filtered out: {cur.rowcount}") sqlite_db.commit() - cur.execute(f"DELETE from mints where timestamp <= {start_time}") + cur.execute(f"DELETE from mints where timestamp < {start_time}") print(f"Mints filtered out: {cur.rowcount}") sqlite_db.commit() - print(f"Remove by timestamp >= {end_time}") + print(f"Remove by timestamp > {end_time}") if end_time: - cur.execute(f"DELETE from transfers where timestamp >= {end_time}") + cur.execute(f"DELETE from transfers where timestamp > {end_time}") print(f"Transfers filtered out: {cur.rowcount}") sqlite_db.commit() - cur.execute(f"DELETE from mints where timestamp >= {end_time}") + cur.execute(f"DELETE from mints where timestamp > {end_time}") print(f"Mints filtered out: {cur.rowcount}") sqlite_db.commit()