Repository navigation
Conversation
The C extension's metadata() now returns maxminddb.reader.Metadata, the dataclass that the pure Python reader returns. Metadata from both readers is now the same type, compares equal, and works with repr() and dataclasses.asdict(). maxminddb.extension.Metadata stays as an alias of this class. As with the pure Python class, hash() raises TypeError, and the constructor takes only keyword arguments. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Extension integration extension/maxminddb.c |
The extension imports Metadata from maxminddb.reader and constructs metadata with keyword arguments. It removes the extension-defined type and its constructor, fields, and properties. |
Public contract and validation maxminddb/extension.pyi, tests/reader_test.py, HISTORY.rst |
The stub re-exports the reader’s Metadata. Tests check the shared class, equality, representation, dataclass values, and unhashability. The changelog records the shared class and its documented behavior. |
Estimated code review effort: 2 (Simple) | ~12 minutes
Change: Bug fix
Suggested reviewers: horgh
Merge Risk: 
Minimal · up to 5cace
-
The shared metadata change has no identified merge-blocking risk.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passedFull details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 3 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
A rabbit checks the fields with care,
One Metadata class is now shared there.
The readers match in form and name,
Their frozen values play the same.
I twitch my nose and hop away.
Comment @coderabbitai help to get the list of available commands.
The C extension's
metadata()now returnsmaxminddb.reader.Metadata, the same dataclass the pure Python reader returns. Metadata from both readers is the same type, compares equal with==, and works withrepr()anddataclasses.asdict().maxminddb.extension.Metadatastays as an alias of that class.User-visible changes compared with 3.2.0, all listed in HISTORY.rst:
type(reader.metadata())ismaxminddb.reader.Metadatain both modes.hash()raisesTypeError, as it already did for the pure Python class.TypeError, and assignment raisesdataclasses.FrozenInstanceError.The extension builds the keyword arguments with one
Py_BuildValuecall and calls the class after releasing the read lock, as before. Tests pass with the extension forced, with it disabled, and on free-threaded 3.14t.Related: #468.
🤖 Generated with Claude Code
Summary by CodeRabbit
Metadatatype. Metadata values from both readers compare equally and supportrepr()anddataclasses.asdict().FrozenInstanceError.