feat: add analyzers, choices, buoy/gear CRUD, and reports methods (ERA-12682)#41
Open
JoshuaVulcan wants to merge 6 commits intomainfrom
Open
feat: add analyzers, choices, buoy/gear CRUD, and reports methods (ERA-12682)#41JoshuaVulcan wants to merge 6 commits intomainfrom
JoshuaVulcan wants to merge 6 commits intomainfrom
Conversation
JoshuaVulcan
added a commit
that referenced
this pull request
Feb 11, 2026
- Add AsyncERClient._get_raw() to return raw httpx.Response for binary endpoints - Use _get_raw in async download_choice_icons() and get_sitrep() so callers get response.content / stream instead of broken JSON parse - Update async tests to mock binary content and assert on response.content Addresses ER_CLIENT_PR_REVIEWS.md: PR #41 dependency check and get_sitrep binary response. Self-contained (no dependency on PR #42 _get_response). Co-authored-by: Cursor <cursoragent@cursor.com>
…A-12682) Add read-only and CRUD endpoints for miscellaneous DAS apps to both ERClient (sync) and AsyncERClient (async): Analyzers: - get_analyzers_spatial() - list spatial analyzers - get_analyzers_subject() - list subject analyzers Choices: - get_choices() - list all choice sets - get_choice(id) - get a single choice set - download_choice_icons() - download choice icons zip Buoy/Gear CRUD: - get_gear_list() - list gear items - get_gear(id) - get single gear item - post_gear(payload) - create gear item - patch_gear(id, payload) - update gear item - delete_gear(id) - delete gear item Reports/Tableau: - get_sitrep() - download situation report (.docx) - get_tableau_views() - list Tableau views - get_tableau_view(id) - get single Tableau view Also adds async _delete() helper to AsyncERClient. Includes 31 new tests across sync and async test suites. Co-authored-by: Cursor <cursoragent@cursor.com>
- Add AsyncERClient._get_raw() to return raw httpx.Response for binary endpoints - Use _get_raw in async download_choice_icons() and get_sitrep() so callers get response.content / stream instead of broken JSON parse - Update async tests to mock binary content and assert on response.content Addresses ER_CLIENT_PR_REVIEWS.md: PR #41 dependency check and get_sitrep binary response. Self-contained (no dependency on PR #42 _get_response). Co-authored-by: Cursor <cursoragent@cursor.com>
e8a277e to
8e64734
Compare
# Conflicts: # tests/sync_client/conftest.py
Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds client support (sync + async) for several DAS “misc” endpoints—analyzers, choices, buoy/gear CRUD, and reports/Tableau—along with new unit tests to validate URL construction and response handling.
Changes:
- Added ERClient and AsyncERClient methods for analyzers, choices (incl. icon download), buoy/gear CRUD, and sitrep/Tableau report endpoints.
- Introduced an async raw-download helper (
_get_raw) for binary GET responses (icons zip, sitrep docx). - Added new sync and async test modules covering the new endpoints.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
erclient/client.py |
Adds the new sync/async endpoint methods and introduces _get_raw for async binary downloads. |
tests/sync_client/test_analyzers_choices_gear_reports.py |
New sync tests for analyzers/choices/gear/reports client methods. |
tests/async_client/test_analyzers_choices_gear_reports.py |
New async tests for analyzers/choices/gear/reports, including error-path coverage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Comment on lines
1894
to
1899
| async def _delete(self, path, params=None, base_url=None): | ||
| """Perform an async DELETE request. Delegates to _call (204/no body handled there).""" | ||
| return await self._call( | ||
| path=path, payload=None, method="DELETE", params=params, base_url=base_url | ||
| ) | ||
|
|
Comment on lines
+6
to
+8
| import pytest | ||
|
|
||
|
|
Comment on lines
+254
to
+262
| # DELETE returns None from _call (no json body on 204) | ||
| # The async client raises on non-200 via raise_for_status, but 204 is ok. | ||
| # However our _call tries response.json() which will fail on 204. | ||
| # Let's mock a 200 with empty body instead: | ||
| route = m.delete(f"buoy/gear/{GEAR_ID}").respond(httpx.codes.OK, json={}) | ||
|
|
||
| result = await er_client.delete_gear(GEAR_ID) | ||
|
|
||
| assert route.called |
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.
Summary
Implements client methods for miscellaneous DAS app endpoints in both
ERClient(sync) andAsyncERClient(async):get_analyzers_spatial(),get_analyzers_subject()— list spatial and subject analyzersget_choices(),get_choice(id),download_choice_icons()— list/retrieve choice sets and download iconsget_gear_list(),get_gear(id),post_gear(),patch_gear(),delete_gear()— full CRUDget_sitrep(),get_tableau_views(),get_tableau_view(id)— situation report and Tableau viewsAlso adds
_delete()async helper toAsyncERClient.Test plan
tests/sync_client/test_analyzers_choices_gear_reports.pytests/async_client/test_analyzers_choices_gear_reports.pyRelated