Switch WQP default profile from legacy to WQX3.0#230
Open
thodson-usgs wants to merge 3 commits intoDOI-USGS:mainfrom
Open
Switch WQP default profile from legacy to WQX3.0#230thodson-usgs wants to merge 3 commits intoDOI-USGS:mainfrom
thodson-usgs wants to merge 3 commits intoDOI-USGS:mainfrom
Conversation
Change all WQP functions from legacy=True to legacy=False so that get_results, what_sites, and what_activities route to WQX3.0 endpoints by default. Functions without a WQX3.0 equivalent now emit a UserWarning instead of silently returning legacy data. legacy=True still works but triggers a DeprecationWarning. Closes DOI-USGS#121. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Resolved conflicts in wqp.py: PR 230's intent (default legacy=False) already preserved in function signatures. Upstream/main refactored the inline UserWarning blocks for WQX3.0-unavailable services into the _legacy_only_url() helper; took upstream's version everywhere. All 12 wqp tests pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #121
Summary
legacy=Truetolegacy=Falseget_results,what_sites, andwhat_activitiesnow route to WQX3.0 endpoints by defaultwhat_organizations,what_projects,what_detection_limits,what_habitat_metrics,what_project_weights,what_activity_metrics) emit aUserWarningwhen called with the defaultlegacy=False, making it clear the user is getting legacy datalegacy=Truestill works but triggers aDeprecationWarningdirecting users to remove it_warn_wqx3_use()function (WQX3.0 is no longer experimental)Behavior change demo (live API)
Test plan
test_what_sitesandtest_what_activitiesto mock WQX3.0 URLstest_get_results_legacyto verifylegacy=TruetriggersDeprecationWarningget_resultscall routes to/wqx3/Result/searchand returns data;legacy=Trueroutes to/data/Result/Searchand emits the expectedDeprecationWarning.