Skip to content

Commit 89b960c

Browse files
committed
define max_results when it is an input
1 parent dc24658 commit 89b960c

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

dataretrieval/waterdata_helpers.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,10 @@ def _construct_api_requests(
310310
# If limit is none and max_results is not none, then set limit to max results. Otherwise,
311311
# if max_results is none, set it to 10000 (the API max).
312312
params["limit"] = max_results if limit is None and max_results is not None else limit or 10000
313+
# Add max results as a parameter if it is not None
314+
if max_results is not None:
315+
params["max_results"] = max_results
316+
313317
if max_results is not None and limit is not None and limit > max_results:
314318
raise ValueError("limit cannot be greater than max_result")
315319

0 commit comments

Comments
 (0)