Skip to content

Commit 3967c8e

Browse files
thodson-usgsclaude
andcommitted
refactor(waterdata): drop now-unused geopd param from _paginate
Moving the geopandas advisory to import time removed _paginate's only use of its `geopd` argument; the param was dead (callers still passed it but the body ignored it). Drop it from the signature, docstring, and both call sites (_walk_pages, get_stats_data). _walk_pages still takes geopd — it uses it to build its parse_response closure. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 5135bb5 commit 3967c8e

1 file changed

Lines changed: 0 additions & 7 deletions

File tree

dataretrieval/waterdata/utils.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,6 @@ def _aggregate_paginated_response(
854854
def _paginate(
855855
initial_req: requests.PreparedRequest,
856856
*,
857-
geopd: bool,
858857
parse_response: Callable[[requests.Response], tuple[pd.DataFrame, _Cursor | None]],
859858
follow_up: Callable[[_Cursor, requests.Session], requests.Response],
860859
client: requests.Session | None = None,
@@ -873,10 +872,6 @@ def _paginate(
873872
----------
874873
initial_req : requests.PreparedRequest
875874
First-page request to send.
876-
geopd : bool
877-
Whether ``geopandas`` is available — logged once at WARNING
878-
level when ``False`` (matches historical behavior of both
879-
callers).
880875
parse_response : callable
881876
``resp -> (df, next_cursor_or_None)``. Returns the page's
882877
DataFrame and the cursor (URL, token, …) used to drive
@@ -1033,7 +1028,6 @@ def follow_up(cursor: str, sess: requests.Session) -> requests.Response:
10331028

10341029
return _paginate(
10351030
req,
1036-
geopd=geopd,
10371031
parse_response=parse_response,
10381032
follow_up=follow_up,
10391033
client=client,
@@ -1499,7 +1493,6 @@ def follow_up(cursor: str, sess: requests.Session) -> requests.Response:
14991493
with _progress.progress_context(service=service):
15001494
df, response = _paginate(
15011495
req,
1502-
geopd=GEOPANDAS,
15031496
parse_response=parse_response,
15041497
follow_up=follow_up,
15051498
client=client,

0 commit comments

Comments
 (0)