Add residential sub-object to anonymizer for Insights#413
Conversation
|
Warning Review limit reached
Next review available in: 57 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
📝 WalkthroughWalkthroughThe change adds residential anonymizer data to factors and insights fixtures, verifies its parsed model and webservice fields, and documents the optional field and ChangesResidential anonymizer coverage
Estimated code review effort: 1 (Trivial) | ~5 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request adds support for the residential attribute inside the ip_address.anonymizer object, which contains residential proxy data such as confidence, network_last_seen, and provider_name. The changes include updates to the history log, test response JSON fixtures, and unit tests verifying the parsing and correctness of these new fields. There are no review comments, so I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/test_models.py`:
- Around line 200-204: Update tests/test_models.py lines 200-204 to cover both
populated and absent residential fields, including to_dict() serialization;
update tests/test_models.py lines 246-252 to assert serialized residential
values; update tests/test_webservice.py lines 239-246 with an absent-field
response case and serialization coverage, preserving correct None handling.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 0dd91c2a-58f1-4299-9987-8cdbf74e7709
📒 Files selected for processing (5)
HISTORY.rsttests/data/factors-response.jsontests/data/insights-response.jsontests/test_models.pytests/test_webservice.py
The web service now nests a `residential` object inside `ip_address.anonymizer` containing residential proxy data for the network. It may be populated even when no other anonymizer attributes are set. The attribute is exposed automatically via the geoip2 dependency's new `Anonymizer.residential` attribute (a `geoip2.records.AnonymizerFeed`), so no model changes are needed here. Update the test fixtures and assertions to cover the new field, and note the change and the geoip2 5.3.0 minimum in HISTORY.rst. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Use object rather than Any for the discarded **_ keyword-argument parameters. object is the correct type for values that are accepted but never used, and it satisfies Ruff's ANN401 rule, so the per-file ANN401 ignores can be removed. The two constructors that forward **kwargs on to the geoip2 parent constructors keep Any (with an inline noqa), since object is not assignable to the parent's typed parameters. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
869a47b to
cd3549b
Compare
Summary
Surfaces the new
residentialsub-object of theanonymizerobject in the minFraud Insights and Factorsip_addressresponse. The models reuse the GeoIP2 library's Anonymizer record, so this is a fixtures/tests/changelog change; the field flows through via the dependency.Depends on maxmind/GeoIP2-python#440. At release time the
geoip2requirement must be bumped to>=5.3.0once that version is on PyPI.Testing
With geoip2 built from that PR: pytest 246 passed; ruff check, ruff format --check, and mypy clean. Against released geoip2 5.2.0 the new assertions fail as expected.
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation
Tests