ERA-12666: Add mapping and spatial feature methods to both clients#34
Open
JoshuaVulcan wants to merge 6 commits intomainfrom
Open
ERA-12666: Add mapping and spatial feature methods to both clients#34JoshuaVulcan wants to merge 6 commits intomainfrom
JoshuaVulcan wants to merge 6 commits intomainfrom
Conversation
5 tasks
JoshuaVulcan
added a commit
that referenced
this pull request
Feb 11, 2026
- Add warnings.warn(DeprecationWarning) in async get_feature_group() - Delegate to get_spatialfeaturegroup() for implementation - Add test that deprecation is emitted and delegation works Addresses ER_CLIENT_PR_REVIEWS.md prescriptive action for PR #34. Co-authored-by: Cursor <cursoragent@cursor.com>
JoshuaVulcan
added a commit
that referenced
this pull request
Feb 11, 2026
- Replace custom async _delete() with one-liner delegating to _call() - Add 204 No Content handling in _call() (return True for DELETE success) - Aligns with PR #34 pattern and reduces merge conflicts with other PRs Co-authored-by: Cursor <cursoragent@cursor.com>
JoshuaVulcan
added a commit
that referenced
this pull request
Feb 11, 2026
…g to _call() - Async _delete() now delegates to _call(path=path, payload=None, method='DELETE', params=params) - Add 204 / empty-body handling in async _call() so DELETE responses don't trigger JSON parse - Aligns with PR review: use _call() delegation pattern like PRs #28, #29, #34; reduces merge conflict Co-authored-by: Cursor <cursoragent@cursor.com>
ERA-12666: Adds complete feature parity for mapping/spatial endpoints: ERClient (sync) and AsyncERClient (async): - get_features, get_feature: GeoJSON feature read - get_featuresets, get_featureset: Feature set read - get_maps: Map listing - get_layers, get_layer: Map layer read - get_featureclasses: Spatial feature type listing - get_spatialfeaturegroups, get_spatialfeaturegroup: Spatial feature group list/detail - post_spatialfeaturegroup, patch_spatialfeaturegroup, delete_spatialfeaturegroup: Group CRUD - get_spatialfeatures, get_spatialfeature: Spatial feature list/detail - post_spatialfeature, patch_spatialfeature, delete_spatialfeature: Feature CRUD - AsyncERClient._delete helper for DELETE operations Includes 54 tests covering success, not-found, forbidden, and error scenarios for both sync and async clients. Co-authored-by: Cursor <cursoragent@cursor.com>
- Add warnings.warn(DeprecationWarning) in async get_feature_group() - Delegate to get_spatialfeaturegroup() for implementation - Add test that deprecation is emitted and delegation works Addresses ER_CLIENT_PR_REVIEWS.md prescriptive action for PR #34. Co-authored-by: Cursor <cursoragent@cursor.com>
e1a3fe2 to
265069d
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 mapping and spatial feature API coverage to both the synchronous (ERClient) and asynchronous (AsyncERClient) EarthRanger clients, along with comprehensive sync/async test coverage for the new endpoints.
Changes:
- Added read-only mapping endpoints (features, featuresets, maps, layers, feature classes) to
ERClientandAsyncERClient. - Added full CRUD methods for spatial feature groups and spatial features to both clients.
- Added new sync and async test suites covering success and common error scenarios for the new endpoints.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
erclient/client.py |
Adds mapping + spatial feature group/feature methods to both sync and async clients; deprecates async get_feature_group in favor of get_spatialfeaturegroup. |
tests/sync_client/test_mapping_spatial.py |
New sync tests validating mapping + spatial CRUD behaviors and error handling. |
tests/async_client/test_mapping_spatial.py |
New async tests validating mapping + spatial CRUD behaviors (incl. deprecated method warning behavior). |
💡 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.
| response = MagicMock() | ||
| response.ok = 200 <= status_code < 400 | ||
| response.status_code = status_code | ||
| response.text = json.dumps(json_data) if json_data else "" |
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
ERClient(sync) andAsyncERClient(async)AsyncERClient._deletehelper method for DELETE operations_callfor proper DELETE response handlingTest plan
Resolves ERA-12666