Add residential sub-object to anonymizer for Insights#440
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughAdds a typed ChangesResidential anonymizer feed and typing updates
Estimated code review effort: 3 (Moderate) | ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 GeoIP Residential Proxy database by introducing the AnonymizerFeed class and a new residential attribute to the Anonymizer record. The changes include updating the Anonymizer initialization to parse residential proxy data, updating the history log, and adding unit tests to verify the parsing and default behaviors of the new attribute. 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.
d9852f9 to
a46411b
Compare
a46411b to
bdb75bb
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@src/geoip2/records.py`:
- Around line 294-301: Update the unused keyword-argument parameter in the
__init__ method to annotate its values with object instead of Any, preserving
the existing **_ behavior and accepted arguments.
In `@tests/models_test.py`:
- Around line 346-355: Add to_dict() serialization assertions in
tests/models_test.py at lines 346-355 and 371-379: assert the absent-field case
serializes to {"traits": {"ip_address": "5.6.7.8"}}, and the residential-only
case serializes to the specified anonymizer.residential data alongside traits.
Preserve the existing attribute assertions.
🪄 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: 8d8d72c4-6fcd-432b-a6eb-36e20c648bd3
📒 Files selected for processing (3)
HISTORY.rstsrc/geoip2/records.pytests/models_test.py
The GeoIP Insights web service now nests a residential object inside the anonymizer object. Add a reusable geoip2.records.AnonymizerFeed record (confidence, network_last_seen, provider_name) so additional anonymizer feeds can share the same shape, and expose it as Anonymizer.residential. The residential attribute may be populated even when no other anonymizer attributes are set, so the anonymizer object may now contain only the residential attribute. 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 ignore for models.py and records.py can be removed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
bdb75bb to
a1e227a
Compare
Summary
The GeoIP Insights web service is adding a
residentialsub-object to theanonymizerobject. It contains residential proxy data for the network and may be populated even when no other anonymizer properties are set.confidence,network_last_seen,provider_name) namedAnonymizerFeed, so future anonymizer feeds can share itresidentialproperty on theAnonymizerrecordAlso converts the
__import__("datetime")inline-import hack in tests/models_test.py to a normal top-level import.Testing
pytest(79 passed),ruff check,ruff format --check, andmypyall pass.🤖 Generated with Claude Code
Summary by CodeRabbit