Skip to content

stop deprecated Extra.allow access in Node - #88

Merged
ChrisCoder9000 merged 1 commit into
Lumen-Labs:mainfrom
xyf5432:fix/pydantic-v2
Aug 27, 2026
Merged

stop deprecated Extra.allow access in Node#88
ChrisCoder9000 merged 1 commit into
Lumen-Labs:mainfrom
xyf5432:fix/pydantic-v2

Conversation

@xyf5432

@xyf5432 xyf5432 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Fixes #87

Summary

Replaces the deprecated Extra.allow member access inside Node's nested
class Meta in src/constants/kg.py with the literal string "allow", and drops
the now-unused Extra import.

Every import of src/constants/kg.py under pydantic v2 currently emits a
PydanticDeprecatedSince20 warning. This removes it.

Changes

  • src/constants/kg.py: extra = Extra.allowextra = "allow"; import line
    drops Extra (BaseModel, ConfigDict, Field).

Notes

  • The nested class Meta is inert as far as pydantic is concerned (only
    Config/model_config are honored), so this is a strict no-behavior-change fix.
    If the docstring intent — actually allowing extra properties — is wanted, that is
    a separate change (model_config = ConfigDict(extra="allow") on Node) that
    should land deliberately, as it changes runtime behavior.

Testing

  • Verified with pydantic 2.13.4: importing the module emits zero warnings
    (before: 1 DeprecationWarning), model construction behavior unchanged.

Co-Authored-By: Claude <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5976f3b5-9079-49d5-9840-59b8ec151275

📥 Commits

Reviewing files that changed from the base of the PR and between 61dc3ec and d4ad0b5.

📒 Files selected for processing (1)
  • src/constants/kg.py

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

The change updates the Pydantic import in src/constants/kg.py and changes Node.Meta.extra from Extra.allow to "allow".

Changes

Pydantic configuration update

Layer / File(s) Summary
Node model configuration
src/constants/kg.py
The module replaces the Extra import with Field. Node.Meta.extra now uses the string value "allow".

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to d4ad0

This localized change removes a deprecation warning without changing Node validation or caller-visible behavior. No actionable merge-blocking risk remains after normal checks and review.

Poem

A rabbit checks the model’s gate
"allow" now marks the state
Extra hops away
Field joins the array
Small changes keep the schema straight

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: removing deprecated Extra.allow access from Node.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@xyf5432 xyf5432 changed the title stop deprecated Extra.allow access in Node (fixes #87) stop deprecated Extra.allow access in Node Aug 27, 2026
@ChrisCoder9000
ChrisCoder9000 merged commit b434f92 into Lumen-Labs:main Aug 27, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DeprecationWarning on import: Extra.allow inside a dead class Meta (pydantic v2)

2 participants