refactor: Wire up ResilientSession for all API calls#8
Open
Conversation
Replace direct requests.get/post calls with get_session().get/post to leverage the existing resilience infrastructure that provides: - Connection pooling for improved performance - Automatic retries with exponential backoff - Rate limiting (100ms minimum between requests) - Consistent error handling Changes: - core.py: 3 requests.post calls → get_session().post - datasets.py: 1 requests.get call → get_session().get - vectors.py: 1 requests.get call → get_session().get - regions.py: 1 requests.get call → get_session().get - intersect_geometry.py: 1 requests.post call → get_session().post (kept 60s timeout for geometry operations) Removed redundant raise_for_status() calls since ResilientSession handles HTTP errors internally. Updated test mocks to patch get_session instead of requests module. Added test_resilient_session_is_used to verify the session is called. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The validate workflow references this file but it was in .gitignore and never committed. This adds the file to the repo and fixes the rpy2 DeprecationWarning issue for newer rpy2 versions. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix get_census() test to include vector (API requires at least one) - Update workflow to fail only on actual test failures, not skipped tests - When R is unavailable, tests are skipped but CI should pass if no failures Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add pull-requests: write permission to allow commenting - Add continue-on-error: true so comment failure doesn't fail workflow Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🧪 R Equivalence Validation ResultsSee full validation report in artifacts. |
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
Replace direct
requests.get/postcalls withget_session().get/postto leverage the existing resilience infrastructure.Changes
core.py: 3requests.post→get_session().postdatasets.py: 1requests.get→get_session().getvectors.py: 1requests.get→get_session().getregions.py: 1requests.get→get_session().getintersect_geometry.py: 1requests.post→get_session().post(kept 60s timeout)raise_for_status()calls (ResilientSession handles this)get_sessioninstead ofrequestsWhy
The
ResilientSessionclass was built but never wired up. It provides:Test plan
test_resilient_session_is_usedto verify session is called🤖 Generated with Claude Code