Skip to content

Add residential sub-object to anonymizer for Insights#440

Open
oschwald wants to merge 1 commit into
mainfrom
greg/stf-997-add-residential-to-anonymizer
Open

Add residential sub-object to anonymizer for Insights#440
oschwald wants to merge 1 commit into
mainfrom
greg/stf-997-add-residential-to-anonymizer

Conversation

@oschwald

@oschwald oschwald commented Jul 10, 2026

Copy link
Copy Markdown
Member

Summary

The GeoIP Insights web service is adding a residential sub-object to the anonymizer object. It contains residential proxy data for the network and may be populated even when no other anonymizer properties are set.

  • New reusable record for the feed shape (confidence, network_last_seen, provider_name) named AnonymizerFeed, so future anonymizer feeds can share it
  • New residential property on the Anonymizer record
  • Tests, fixtures, and changelog updated

Also 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, and mypy all pass.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added support for Residential Proxy feed details in anonymizer insights.
    • Residential proxy information can include provider name, confidence, and the date the network was last seen.
    • Residential proxy data is available even when other anonymizer details are not provided.
    • Dates are presented in a standard date format.
  • Documentation

    • Updated release history with details about the new residential proxy attribute.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 4373c109-c451-4f8f-b7eb-ac34bd3181cc

📥 Commits

Reviewing files that changed from the base of the PR and between d9852f9 and a46411b.

📒 Files selected for processing (3)
  • HISTORY.rst
  • src/geoip2/records.py
  • tests/models_test.py

📝 Walkthrough

Walkthrough

Adds a typed AnonymizerFeed for Residential Proxy data, wires it into Anonymizer, parses network_last_seen as a date, and adds tests for full, minimal, and residential-only Insights data.

Changes

Residential anonymizer feed

Layer / File(s) Summary
Residential feed model and wiring
src/geoip2/records.py
Adds AnonymizerFeed, exposes Anonymizer.residential, accepts optional residential data, and parses network_last_seen.
Residential feed validation and documentation
tests/models_test.py, HISTORY.rst
Tests populated, missing, and residential-only feed data and documents the new attribute.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: horgh, marselester, dlieou, 2shortplanks

Poem

A rabbit found a feed so neat,
With dates and names and confidence sweet.
The anonymizer learned its part,
Tests confirmed each nested chart.
Hop, hop—the changelog’s complete!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding an Insights anonymizer residential sub-object.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch greg/stf-997-add-residential-to-anonymizer

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

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>
@oschwald oschwald force-pushed the greg/stf-997-add-residential-to-anonymizer branch from d9852f9 to a46411b Compare July 14, 2026 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant