Skip to content

Commit

Permalink
fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
myrho committed Mar 15, 2024
1 parent 497283c commit 5ca9b81
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gsrest/db/cassandra.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,15 @@ 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:
continue
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
Expand All @@ -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


Expand Down

0 comments on commit 5ca9b81

Please sign in to comment.