Skip to content

Commit aa399be

Browse files
thodson-usgsclaude
andauthored
Fix get_reference_table: propagate limit to query args (#248)
* Fix get_reference_table: propagate limit to query args The signature accepted and documented a `limit` parameter, but the function never forwarded it into `query_args`, so every call fetched at the schema/server default regardless of what the user requested. Forward `limit` into a copy of the user-supplied `query` dict (so the caller's dict is not mutated) when it is not None. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Cover the limit + query branch with no-mutation assertion Per copilot review on PR #248. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Drop trivial regression tests for limit propagation Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 98b3057 commit aa399be

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

dataretrieval/waterdata/api.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1542,7 +1542,9 @@ def get_reference_table(
15421542
else:
15431543
output_id = f"{collection.replace('-', '_')}"
15441544

1545-
query_args = query or {}
1545+
query_args = dict(query) if query else {}
1546+
if limit is not None:
1547+
query_args["limit"] = limit
15461548
return get_ogc_data(args=query_args, output_id=output_id, service=collection)
15471549

15481550

0 commit comments

Comments
 (0)