Repository navigation
feat(waterdata)!: a cloud-optimized architecture that routes query chunks to the STAC files or the OGC API - #476
thodson-usgs wants to merge 18 commits into
Conversation
… bulk setting USGS now publishes the daily and continuous collections as Parquet files, one set per monitoring location, rewritten every night and indexed by the Water Data STAC catalog (https://waterdata.usgs.gov/blog/api-faster-access/). This commit combines DOI-USGS#475 and DOI-USGS#476. waterdata.get_parquet_files(collection, ...) lists the files. It searches the catalog by monitoring location, time, bbox, or a CQL2 filter over monitoring-location fields, and returns (DataFrame, BaseMetadata) with one row per file. It downloads nothing. A Water Data setting, bulk ("off", "auto", "always"), makes get_daily and get_continuous read a location's history from those files and only the records changed since from the API. "off" is the default and changes no call. "auto" reads the files for a query large enough to finish sooner, and "always" for every query they can answer. ADR 0014 records the design, the merge rule, the routing rule and its benchmark, and the alternatives. Structure: - waterdata.catalog.search is the one catalog search. It owns the edge's 2,094-character URL limit: it splits a long monitoring_location_id list across concurrent searches that fit, and raises before any request when the rest of the query cannot fit. get_ratings, get_parquet_files, and the bulk path pass identifiers and expressions and never size a URL. - The getters call one entry point, waterdata._bulk.get_data, which reads the setting and answers from the files or the API. A call's arguments are parsed once into a query, and what differs between daily and continuous is one table. - The file downloads run on FanOut, which combines their rows. The change query and the merge are its finalize hook, so exc.call.resume() returns the whole result. - transport.fanout.inert_response is the body-less response a download hands the executor. It moved from ratings, so the bulk path does not import from another collection family. Result contract: daily_id and continuous_id are random version-4 UUIDs that the files do not hold. With "auto" or "always", a query the files can answer returns no such column, whether the files or the API answered it, so the columns do not depend on the route. A query only the API accepts, and every call under "off", is returned as before. A record deleted from the API since the files were written is still returned until the next night's files. Bug fixes in get_ratings: the search is limited to the ratings collection (it returned daily and continuous items for a list of file types), and a long monitoring_location_id list no longer fails with HTTP 403. pyarrow is a new optional extra, dataretrieval[bulk]. Without it, a query the setting sends to the files pages the API and warns. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
3a888d9 to
1b76246
Compare
… bulk setting USGS now publishes the daily and continuous collections as Parquet files, one set per monitoring location, rewritten every night and indexed by the Water Data STAC catalog (https://waterdata.usgs.gov/blog/api-faster-access/). This commit combines DOI-USGS#475 and DOI-USGS#476. waterdata.get_parquet_files(collection, ...) lists the files. It searches the catalog by monitoring location, time, bbox, or a CQL2 filter over monitoring-location fields, and returns (DataFrame, BaseMetadata) with one row per file. It downloads nothing. A Water Data setting, bulk ("off", "auto", "always"), makes get_daily and get_continuous read a location's history from those files and only the records changed since from the API. "off" is the default and changes no call. "auto" reads the files for a query large enough to finish sooner, and "always" for every query they can answer. ADR 0014 records the design, the merge rule, the routing rule and its benchmark, and the alternatives. Structure: - waterdata.catalog.search is the one catalog search. It owns the edge's 2,094-character URL limit: it splits a long monitoring_location_id list across concurrent searches that fit, and raises before any request when the rest of the query cannot fit. get_ratings, get_parquet_files, and the bulk path pass identifiers and expressions and never size a URL. - The getters call one entry point, waterdata._bulk.get_data, which reads the setting and answers from the files or the API. A call's arguments are parsed once into a query, and what differs between daily and continuous is one table. - The file downloads run on FanOut, which combines their rows. The change query and the merge are its finalize hook, so exc.call.resume() returns the whole result. - transport.fanout.inert_response is the body-less response a download hands the executor. It moved from ratings, so the bulk path does not import from another collection family. Result contract: daily_id and continuous_id are random version-4 UUIDs that the files do not hold. With "auto" or "always", a query the files can answer returns no such column, whether the files or the API answered it, so the columns do not depend on the route. A query only the API accepts, and every call under "off", is returned as before. A record deleted from the API since the files were written is still returned until the next night's files. Bug fixes in get_ratings: the search is limited to the ratings collection (it returned daily and continuous items for a list of file types), and a long monitoring_location_id list no longer fails with HTTP 403. pyarrow is a new optional extra, dataretrieval[bulk]. Without it, a query the setting sends to the files pages the API and warns. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
1b76246 to
4be181f
Compare
get_daily and get_continuous now choose per query, without a request, between the nightly Parquet files plus the API's changes and the API alone. This is a breaking change for the next major release: under "auto", a query the files can answer returns no daily_id / continuous_id column, whichever path returned it. bulk = "off" in the [waterdata] table keeps the column. The default is a named constant, DEFAULT_BULK, beside BULK_MODES. Tests of the API path take a bulk_off fixture. The [doc] extra installs pyarrow, because the demos run under the default. ADR 0014 is corrected from live checks on 2026-11-23: historical files are rewritten only after one of their records changes (Last-Modified from 2026-10-26 to that night across ten gages), current starts at the value after historical ends, and the OGC API, the catalog, and the files share one hourly count per key with ceilings of 1,000, 4,000, and 10,000. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Am I reading this correctly? On "auto", a request for 2025-present data for 3 sites will hit the STAC files and the OGC API because the number of rows returned will be > 10,000? |
One get_continuous call drawn as its catalog request, its chunk plan, and the fan-out that sends each chunk through the load balancer to the STAC catalog, the Parquet files, or the OGC API. The TikZ source sits beside the rendered PNG, with the commands that rebuild it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The catalog request now passes under the chunk plan and enters the fan-out from below, so the STAC catalog lane is the bottom one. The endpoints are evenly spaced, the fan-out and the load balancer are only as tall as they need to be, and the two side labels are centered over their sides of the boundary. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
USGS counts requests per key, with an hourly ceiling of 1,000 for the OGC API and 10,000 for the files. A bulk pull of more than about 1,000 files under one key left the change query, which runs last, no OGC requests. The service's maintainer recommends a separate key for the files. files_api_key (API_USGS_FILES_PAT) is package-wide, like api_key. The credentials leaf sends it in place of api_key on requests under /stac-files/ and falls back to api_key when it is unset. Catalog searches stay on api_key. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The chunk plan's columns are now labeled as a location's historical and current files, so the figure shows that a chunk is a file. The service's maintainer says the files can be a week behind the API, not a day; the path reads its cutoff from each file, so the result is unaffected, and the ADR now says so. It also records files_api_key. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The service's maintainer suggested one key for /stac and /stac-files and another for /ogcapi. With catalog searches on api_key, a bulk call spent two requests against the OGC API's ceiling of 1,000, a search and the change query. Now the change query is the only request the files path sends under api_key. The cost is the catalog's ceiling: once the files' key has made 4,000 requests in an hour, the next query's search is refused before any download. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…een files The continuous collection refuses a time argument with an open start or a span over 1,100 days. A query that long was routed to the files, downloaded every one, and then failed, because the change query sent the same time. The change query now sends no time when the API would refuse it: a change clause needs none, the clause for locations without a file carries the bounds, and the merge applies them. Live, 8 gages since 2000 returned 2.44 million rows in 12.8 s, equal to the API on the days compared. A location's two files written on different nights leave the span between them in neither, and no change clause returns it. Where current starts more than 12 hours after historical ends, one more clause asks the API for that span. The cutoff is now the current file's instead of the later of the two, so a current file older than its historical no longer hides the changes made since its own snapshot. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The extra installs only pyarrow, and pyarrow has other uses: with pandas 3 it also reduces a result's memory. An extra named for the package covers both, so a second extra installing the same thing is never needed. The bulk extra was new on this branch and never released, so no alias is kept. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The rename in the previous commit changed the install command the warning names, and this test still matched the old one. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A page whose values are all null for a text column has an object column, and concatenating the pages widens the other pages' strings to object. On pandas 3 the same query could therefore return method_category as str or object, depending on how the rows fell into pages; live, the continuous files path and the API path disagreed on five sites. _finalize_ogc now re-infers each object column. It works column by column because DataFrame.infer_objects leaves object columns that share a block as they are (pandas 3.1), which the first attempt missed on a real result. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… fixes Change query (ADR 0014, measured cold on 2026-11-24 with never-queried sites and a unique window per run): - A daily change query sends no time window; the rows outside the window are dropped before the merge. With the window, the API took up to 9 s to answer a change query that returned few rows, and 2 to 6 s without it. The daily files path was faster in 5 of 7 query shapes, the same in 1, and 2 s slower in 1. A continuous change query keeps its window: without it the query took 11 to 14 s or timed out. - The change query is split into up to 8 concurrent requests, then 10 locations each, but no more requests than the concurrency cap. The API's time grows with the locations a request names: 100 gages took 12.1 s as one request and 1.2 s as ten. It asks the chunker for that fan-out with a per-call chunks= argument, so the library never enters the caller's configuration; a larger parallel_chunks setting still wins. Routing: the daily base is 5,000 estimated rows (continuous keeps 10,000), and a small file costs 100 rows. A location with many series is underestimated severalfold: one such site over 5 years took 4.6 s from the API and 1.8 s from the files. Review fixes: - The files path returns continuous geometry. - The record id is left out of every answer under "auto" and "always" unless properties names it. - 403 and 429 messages name the key the request was sent (credentials.key_variables), and a refused catalog or file request names bulk='off'. - Without pyarrow, a get_continuous time over 1,100 days or with an open start raises ValueError before any request. - md is the same on either path: md.url is the URL bulk='off' sends, and md.query_time sums every request. - An interruption of the change query resumes through the downloads (FanOutInterrupted._bind), and the downloads are no longer kept alive after return by a reference cycle with their finalize hook. - The merge gives an all-null text column the files' type before the concat, instead of widening and narrowing every row. - The configuration guide's example profile is [waterdata.overnight], since a [waterdata.bulk] table cannot sit beside the bulk setting. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The figure's 50 locations now split into 8 change-query requests of up to 7 locations each (chunks 101 to 108), as the code sends them. ADR 0014's step 4 names the clause per cutoff day and group of locations, and the per-call chunk count the change query asks for. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The figure is drawn at 18 cm, so its type prints at the sizes set: 12 pt for the two sides, 9 pt bold for each step and endpoint, 8 pt for labels, 7 pt for chunk numbers. A rule under each side's name spans that side, the file dates move to a time axis under the chunk plan, and the note on T moves to the bottom right. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The query passes monitoring_locations positionally with an n=50 comment, the lane counts read 8x, 100x, and 1x, and the file columns are headed historical and current. The saved width goes to the file columns. The chunk plan's title sits on its headers, and the note on T moves to the bottom left. The figure stays 18 cm wide. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The catalog request sits under the query on two lines, and its Parquet URLs pass under the code into the chunk plan, so the plan starts after the code. The arrow into the fan-out reads 108x, the plan's chunks. The width this frees widens the plan's columns, and the note on T is one line at the bottom left. The figure stays 18 cm wide; ADR 0014's alt text and caption describe the new layout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The plan's rows are monitoring locations and its columns follow time, so both axes have a title, and the column widths follow the time axis: 360 days for the historical file, about 150 for the current file, and the few days since T for the new records, drawn as wide as their label. The plan shows locations 1 to 4, 49, and 50, which puts the catalog request lower and gives the code room. The note on T moves onto the line of the Time title, and the caption says the catalog request finishes before any chunk starts. The code asked for 7.5 pt, which the typewriter font has no size for, so it was set at 7 pt. It now asks for 8 pt, the size it is set at. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…apart The files route becomes a public package, waterdata.bulk, with get_daily and get_continuous, which read every query from the Parquet files plus the API's changes, and get_urls, which was waterdata.get_parquet_files. A bulk getter's signature holds only the arguments the files can answer, so any other argument is a TypeError at the call, and a test pins each signature to the route's accepted arguments. Without pyarrow, a bulk getter raises ImportError before any request. The bulk setting's router moves to waterdata/_routing.py, with the row estimate's terms in their own table, and calls the route through the same parse and read the bulk getters use. waterdata.get_daily and get_continuous call the router as before. The setting keeps "off" and "auto" and drops "always", which the bulk getters replace. A new import contract keeps waterdata.bulk from importing the router or the API getters, so the package can be released without them. The STAC search stays in waterdata/catalog.py, which get_ratings also uses. The routing tests move to waterdata_routing_test.py; the files route tests call the bulk getters. ADR 0014, the configuration guide, the reference page, CONTEXT.md, and NEWS describe the two entry points. The change query now asks the engine to convert types itself, since a bulk getter's arguments carry no convert_type. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
(For now) I'm leaving the R code as either STAC or OGC. We might consider an argument source = "OGC", "STAC", "auto" in the future, but I wanted to make sure the dedicated STAC functions are solid. If you want to see the R proposed workflow, you can see the introduction vignette here: Looking at this PR I don't think we're that far apart in terms of user experience. |
|
thanks @ldecicco-USGS. I'll take a look. I think I'm also leaning simpler to start, then revisit routing later. |
Summary
Water Data now serves
dailyandcontinuousrecords from two endpoints: the OGC API, which pages through any query, and Parquet files that USGS writes to S3 each night, one set per monitoring location, indexed by a STAC catalog (announcement). This PR adds two ways to read them. A public package,waterdata.bulk, hasget_dailyandget_continuous, which answer every query from the files plus the API's changes, andget_urls, which lists the files. And a routing layer behindwaterdata.get_dailyandwaterdata.get_continuous, with their signatures unchanged, sends a large query the same way. For each query, the router estimates the rows from the arguments, without a request. A small query pages the OGC API as before. A large one is split into chunks, and each chunk goes to one endpoint: one chunk per file reads a location's history from the files, and a few change-query chunks ask the OGC API for the records modified since each file was written, which only the API has. The API's copy of a record replaces the file's, so the result has the API's rows, columns, and types, less the record id.The figure follows one query:
get_continuousfor 50 monitoring locations since 2025-07-01. The catalog request goes through the fan-out to the STAC catalog, and the Parquet URLs it returns are what the chunk plan is built from. The plan has 108 chunks, colored by endpoint: a row for each monitoring location, and columns whose widths follow the time axis. A chunk on the files path is one whole file, so the plan follows the way USGS stores the data: two file downloads per location (thehistoricalfile up to 150 days ago and thecurrentfile from then toT, the time of the last Parquet update), and a change query for every record modified sinceT, sent as 8 chunks of up to 7 locations each (step 3 below). The fan-out sends every request to one load balancer, in three runs in order: the catalog request, the file downloads, and the change query once every file is read. The dashed line is the boundary between dataretrieval-python and the service. The TikZ source is0014-cloud-optimized-architecture.tex, beside the PNG that ADR 0014 includes.Each step divides its work into chunks and sends them as one fan-out. Every chunk goes to the same host, which routes it by URL path to the catalog, the files, or the OGC API.
Steps 3 and 4 run as the downloads'
finalizehook, soexc.call.resume()after an interruption returns the whole result.waterdata.bulk.get_daily/get_continuousmonitoring_location_id(required),parameter_code,statistic_id,time_series_id,approval_status,unit_of_measure,method_category(continuous),time, andskip_geometry; any other argument is aTypeError. Without pyarrow,ImportError.waterdata.get_*,bulk="auto"(default)daily, 10,000 forcontinuous) plus a per-file cost (100 rows for a daily orcurrentfile, 10,000 for ahistoricalone). The API for the rest, including every query the bulk getters could not take.waterdata.get_*,bulk="off"What the service does with the chunks
Checked on 2026-11-23 from DNS and response headers. Every chunk, from either path, is a separate HTTPS request to
api.waterdata.usgs.gov, and every request passes the same hops:api.data.gov, which is a CNAME toexternal-domains-production.cloud.gov. Every response has anx-vcap-request-id.x-api-umbrella-request-id,via: ... api-umbrella). The three paths share one hourly count per key, with a different ceiling for each. After 33 keyed requests spread across the three, the OGC API reported 967 of 1,000 remaining and the catalog 3,968 of 4,000.via: ... cloudfront.netandx-cache. A 2,095-character catalog URL is refused with HTTP 403 andx-cache: Error from cloudfront. The 2,094-character limit is the 46-character path plus 2,048 query-string bytes, which matches the query-string limit of the AWS WAF core rule set./ogcapi/(the OGC API,x-build-version: 1.19.0),/stac/(the STAC API,0.3.4), and/stac-files/(S3:x-amz-server-side-encryptionand multipart ETags). The headers do not show whether the gateway or CloudFront routes by path.The client creates the concurrency:
FanOutsends up toAPI_USGS_CONCURRENTchunks at once. The service has one load balancer in front of every request and then routes each chunk by URL path. No second load balancer is visible. The origins serve concurrent chunks in parallel: a 35-year daily pull took 1.77 s as one request and 0.69 s as 12 concurrent time chunks (measured 2026-11-17 for #469). What runs behind CloudFront is not visible from the client.Issues with the hybrid architecture
Found by reading the files route (now
bulk/_retrieval.py) and checking the files and the API on 2026-11-23. Issues 1, 4, and 5 are fixed or addressed in this PR; the rest are open. Issue 8 was found on 2026-11-24.continuousfiles come from different nights.currentstarts at the value afterhistoricalends (nine gages checked).historicalis rewritten only after one of its records changes: itsLast-Modifiedranged from 2026-10-26 to that night across ten gages. Whenhistoricalis rewritten, its end moves to 150 days before that night, and the newcurrentstarts there. A newcurrentread with an oldhistoricalmisses the records between the two ends, and the change query does not return them because they have not changed. For USGS-02037500 that is four weeks of 15-minute values: itshistoricalends 2026-05-29, and a rewrite on 2026-11-24 would move the end to 2026-06-27. The reverse pair, an oldcurrentwith a newhistorical, overlaps (the merge removes the duplicates), and it misses recent values when the new file's cutoff falls on a later UTC day. CloudFront serves the files withoutCache-Controland kept one for at least 10 minutes. The files were written between 06:11 and 09:21 UTC on 2026-11-23, so a mixed pair is possible during that window and for as long as CloudFront keeps the older file. Not observed. Fixed in 1f5e7e6: where a location'scurrentfile starts more than 12 hours after itshistoricalfile ends, the change query gets one more clause asking the API for every record between them. A gage that recorded nothing there costs an empty answer. The cutoff is now thecurrentfile's instead of the later of the two, so an oldcurrentno longer hides the changes made since its own snapshot.historicalasset would drop history without an error. Not observed._plandownloads only the assets an item lists, and only a 404 marks a location as missing. In 730 Ohiocontinuousitems, 228 listed onlyhistoricaland 6 listed onlycurrent. None of the 6 had API records in the 1,000 days before itscurrentfile starts, and none of 8historical-only items checked had acurrentfile (404). Three of the 6 had an unlistedhistoricalfile at the usual URL, holding 64 to 178 rows that the API no longer serves, so the catalog listing was the correct one. Fix, as a safeguard: when the query needshistoricaland the item has none, add the location tomissing.continuousrecords depend on the rewrite rule. The cutoff is thecurrentfile's newestlast_modified. That is correct whilehistoricalis rewritten the night after one of its records changes. For five gages whosehistoricalpredated the current night, the API had no change in the last 1,000 days of that file's range after it was written. If USGS rewriteshistoricalon a schedule instead, a revision made between rewrites is missed and the result has the old value. Fix: add one clause per group of locations,time <= historical end AND last_modified >= historical written, which returns no rows while the rule holds.continuousquery downloaded every file, then failed. Thecontinuouscollection refuses atimeargument with an open start or a span over 1,100 days (HTTP 400), whatever the filter. Such a query was routed to the files, downloaded them, and then sent the sametimein the change query. The API accepts a query with notime, and a filter can comparetimeitself (both checked live). Fixed in 1f5e7e6: when the query'stimeis over the limit, the change query sends none, and every clause carries the bounds instead. Live,get_continuousfor 8 gages withtime="2000-01-01/.."returned 2.44 million rows in 12.8 s, equal to the API on a 2012 day and over the last week. Under"off"the same call still fails on its first request.files_api_key(API_USGS_FILES_PAT), sent in place ofapi_keyonly on requests under/stac-files/and/stac/, as he suggested, so the downloads and catalog searches have their own count and the change query is the only request the files path sends underapi_key. The cost is the catalog's ceiling: once the files' key has made 4,000 requests in an hour, the next query's search is refused, before any download. With one key, the limit remains, and the interruption is resumable:exc.call.resume()after the hour returns the whole result. Not tested live with two keys.pip install dataretrievaldoes not install pyarrow, so under the new default each largeget_dailyorget_continuouscall pages the API and emits aUserWarning. For the major release, pyarrow could become a required dependency (docs: show how pyarrow reduces result memory, and test with it in CI #468 measured 62% less frame memory with it on pandas 3).(time_series_id, time), so a record whosetimewas corrected would also leave its old file row in the result. Not observed.parameter_codelist takes part of the change query's fan-out. The OGC planner caps the total chunk count across every list argument and the filter. With a list of codes, some chunks split the list, and each request names two or more change clauses, which the API answers more slowly. A single code is not affected. Fix: a planner option that splits the filter first. Not measured.Checked, and not an issue:
historicalfor a query that starts within 120 days is safe:currentcovered 150 to 178 days on every gage checked.parameter_codelist. The request builder folds the list into each chunk after the planner splits atOR. Offline, 600 locations with two codes made 2 GET chunks of at most 7,362 bytes (before the split in step 3).Also in this PR
waterdata.bulk.get_urls(collection, ...)lists the files from the catalog by monitoring location,time,bbox, or a CQL2filter, and downloads nothing. This PR includes feat(waterdata): list the STAC-indexed Parquet files #475, where it waswaterdata.get_parquet_files.waterdata.catalog.searchis the one catalog search, and the only code that sizes a URL for the 2,094-character limit.get_ratingsnow uses it, which fixes two bugs: it searched every collection, and a longmonitoring_location_idlist failed with HTTP 403.files_api_keyis a new package-wide setting for a second API key, used only for the published files and their catalog (issue 5).pyarrowis a new optional extra,dataretrieval[pyarrow], included in[test]and[doc].waterdataandngwmn) types a text column the same however the result was paged. On pandas 3, a column such asmethod_categorywasobjectwhenever one page held only nulls for it. This is its own commit, afdc0b7, so it can ship in a 1.x release.continuousgeometry; the record id is left out of every answer under"auto"unlesspropertiesnames it;mdis the same on both paths; a 403 or 429 names the key the request was sent; an interrupted change query resumes throughexc.call.resume(); and the configuration guide's example profile is[waterdata.overnight], since a[waterdata.bulk]table cannot sit beside thebulksetting."always"mode the bulk getters replace, and includes the figure above. This revision corrects its description of the files from the checks above.Evidence
configuration.bulk(adapter="waterdata")returned"off"with nothing configured, so every call paged the API.After (f1dbec0):
test_bulk_is_auto_unless_code_or_the_waterdata_table_sets_itpasses:"auto"by default,"off"from the[waterdata]table, and aconfigure()block over both. Nine tests of the API path now take abulk_offfixture.bulk="always", and an argument it could not answer raisedValueErrorinside the call.After (b094968):
test_a_bulk_getter_takes_the_arguments_the_files_route_acceptspins each bulk getter's signature to the route's accepted arguments, and thewaterdata-bulkimport contract is KEPT (a probe import oftime_seriesfrombulk/_urls.pymakes it BROKEN). The routing tests are intests/waterdata_routing_test.py.dataretrieval.waterdata.bulkreference section. Live,bulk.get_dailymatcheswaterdata.get_dailyunder"off". The livecontinuouscomparison fails on 4d246e3 and on b094968 alike: USGS-01435000'smethod_categoryis null in every row since 2026-10-01, and on pandas 3 the API path types the columnobjectand the files pathstr. New tests pinfiles_api_key: sent only under/stac-files/and/stac/, never to another host,api_keywhen unset, and never printed byshow_configuration.bulk="off"in all 5 shapes compared. Acontinuouschange query without its window took 11 to 14 s or timed out, so it keeps the window.Merge Danger
Door: one-way for callers of
waterdata.get_dailyandget_continuous. Thewaterdata.bulkpackage changes no existing call and could ship alone in a minor release. The default removesdaily_id/continuous_idfrom everyget_dailyandget_continuousresult the files can answer, including the small queries the router sends to the API. Restoring"off"later would be a second breaking change. In the code, the default is one constant in a private module.Hold for the next major release, and re-date the NEWS entry to the merge date.
Blast Radius: every caller of
get_dailyandget_continuous.A query routed to the files depends on file behavior USGS has not documented as a contract (issues 1 to 3). Before merge, confirm the file layout, the rewrite rule for
historical, and the retention rules with WDFN, and decide whether issues 2, 3, and 6 are fixed here or in follow-ups. The maintainer also says the files can be a week behind the API. The result does not depend on the lag, because the cutoff is read from each file, but the router's benchmark assumed files a day old.🤖 Generated with Claude Code