Skip to content

Commit e4035c1

Browse files
joaquinvanschorenmfeurer
authored andcommitted
fix for list_all. It currently keeps looping forever (until the connection breaks) (#390)
1 parent d3d9cee commit e4035c1

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

openml/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,10 @@ def list_all(listing_call, batch_size=10000, *args, **filters):
118118
dict
119119
"""
120120
page = 0
121+
has_more = 1
121122
result = {}
122123

123-
while True:
124+
while has_more:
124125
try:
125126
new_batch = listing_call(
126127
*args,
@@ -135,5 +136,6 @@ def list_all(listing_call, batch_size=10000, *args, **filters):
135136
break
136137
result.update(new_batch)
137138
page += 1
139+
has_more = (len(new_batch) == batch_size)
138140

139141
return result

0 commit comments

Comments
 (0)