Skip to content

[feat]: support PrivateAttr#49

Merged
pawamoy merged 1 commit intomkdocstrings:mainfrom
danielgafni:support-privateattr
Feb 5, 2026
Merged

[feat]: support PrivateAttr#49
pawamoy merged 1 commit intomkdocstrings:mainfrom
danielgafni:support-privateattr

Conversation

@danielgafni
Copy link
Copy Markdown
Contributor

For reviewers

  • I did not use AI
  • I used AI and thoroughly reviewed every code/docs change

Description of the change

Pydantic's PrivateAttr are now removed from the public fields of the model.

Relevant resources

Resolve #43

@danielgafni
Copy link
Copy Markdown
Contributor Author

IMO the various checks (the new PrivateAttr) are better to be isolated into a separate function since there are quite a few of them now. I didn't want to change this without your approval @pawamoy

@danielgafni
Copy link
Copy Markdown
Contributor Author

Tested on my docs - seems to be working fine

@pawamoy
Copy link
Copy Markdown
Member

pawamoy commented Jan 30, 2026

Thanks @danielgafni, looking good. I'm OK with a refactor that splits apart each check into a dedicated function 🙂 Either as a second commit on this PR (but you'll have to follow our commit message guidelines), or as a second PR, thanks for suggesting!

@danielgafni danielgafni changed the title support PrivateAttr [feat] support PrivateAttr Jan 30, 2026
@danielgafni
Copy link
Copy Markdown
Contributor Author

Let's do another PR then.

I fixed the commit title and body.

The CI is failing on something that seems to be unrelated to my changes?

@danielgafni danielgafni changed the title [feat] support PrivateAttr [feat]: support PrivateAttr Jan 30, 2026
@pawamoy
Copy link
Copy Markdown
Member

pawamoy commented Jan 30, 2026

Yeah don't pay attention to CI I'll fix it. Just make sure tests pass locally 🙂

@danielgafni
Copy link
Copy Markdown
Contributor Author

Hey @pawamoy , pinging in case you've forgotten about this PR (also sorry if this is annoying and let me know if I shouldn't be doing it)

to be clear, the tests were passing locally for me

@pawamoy
Copy link
Copy Markdown
Member

pawamoy commented Feb 2, 2026

Pings are welcome, thanks for asking 😄 I'll get to it soon 🙂

@pawamoy pawamoy force-pushed the support-privateattr branch from 54609c6 to c8ae993 Compare February 5, 2026 16:08
Filter out fields that are marked as `pydantic.PrivateAttr`
@pawamoy pawamoy force-pushed the support-privateattr branch from c8ae993 to c93d1f0 Compare February 5, 2026 16:21
Copy link
Copy Markdown
Member

@pawamoy pawamoy left a comment

Choose a reason for hiding this comment

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

LGTM!

@pawamoy pawamoy merged commit 9491921 into mkdocstrings:main Feb 5, 2026
28 of 34 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.

feature: Support PrivateAttr

2 participants