Skip to content

ERA-12666: Add mapping and spatial feature methods to both clients#34

Open
JoshuaVulcan wants to merge 6 commits intomainfrom
ERA-12666/mapping-spatial-features
Open

ERA-12666: Add mapping and spatial feature methods to both clients#34
JoshuaVulcan wants to merge 6 commits intomainfrom
ERA-12666/mapping-spatial-features

Conversation

@JoshuaVulcan
Copy link
Copy Markdown
Contributor

@JoshuaVulcan JoshuaVulcan commented Feb 11, 2026

Summary

  • Adds complete read-only methods for features, featuresets, maps, layers, and feature classes to both ERClient (sync) and AsyncERClient (async)
  • Adds full CRUD (list, get, create, update, delete) for spatial feature groups and spatial features to both clients
  • Adds AsyncERClient._delete helper method for DELETE operations
  • Adds 204 No Content handling in async _call for proper DELETE response handling

Test plan

  • 27 async tests covering all new endpoints (success, 404, 403 scenarios)
  • 27 sync tests covering all new endpoints (success, 404, 403 scenarios)
  • Full test suite passes (144 tests)
  • Feature parity verified between sync and async clients

Resolves ERA-12666

@JoshuaVulcan JoshuaVulcan added autoreviewing PR is currently being auto-reviewed and removed autoreviewing PR is currently being auto-reviewed labels Feb 11, 2026
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>
JoshuaVulcan and others added 2 commits February 11, 2026 10:18
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>
@JoshuaVulcan JoshuaVulcan force-pushed the ERA-12666/mapping-spatial-features branch from e1a3fe2 to 265069d Compare February 11, 2026 18:18
@JoshuaVulcan JoshuaVulcan requested a review from a team as a code owner February 12, 2026 01:49
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ERClient and AsyncERClient.
  • 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 ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants