From 5ca9b8160f72344fa95965f5191c8a6d29ae4b66 Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 15 Mar 2024 19:24:22 +0100 Subject: [PATCH] fix failing tests --- gsrest/db/cassandra.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gsrest/db/cassandra.py b/gsrest/db/cassandra.py index a548c63..727e222 100644 --- a/gsrest/db/cassandra.py +++ b/gsrest/db/cassandra.py @@ -201,6 +201,7 @@ def merge_address_txs_subquery_results( # find the least common tx_id where we then cut the result sets border_tx_id = None + has_pages = False total_results_len = 0 for results in result_sets: if not results: @@ -208,6 +209,7 @@ def merge_address_txs_subquery_results( total_results_len += len(results) if fetched_limit and len(results) < fetched_limit: continue + has_pages = True if border_tx_id is None: border_tx_id = results[-1][tx_id_keys] continue @@ -233,7 +235,7 @@ def merge_address_txs_subquery_results( # use the last tx_id as page handle border_tx_id = results[-1][tx_id_keys] \ - if results and total_results_len > fetch_size else None + if results and (has_pages or total_results_len >= fetch_size) else None return results, border_tx_id