Skip to content

Conversation

chris-spann
Copy link
Contributor

@chris-spann chris-spann commented Oct 18, 2023

Change Summary

Fixes runtime error when using __doc__ argument for create_model()

Related issue number

fix #7481

Checklist

  • The pull request title is a good summary of the changes - it will be used in the changelog
  • Unit tests for the changes exist
  • Tests pass on CI
  • Documentation reflects the changes where applicable
  • My PR is ready to review, please add a comment including the phrase "please review" to assign reviewers

Selected Reviewer: @samuelcolvin

@chris-spann chris-spann marked this pull request as ready for review October 18, 2023 17:09
@chris-spann
Copy link
Contributor Author

please review

@sydney-runkle
Copy link
Contributor

Hi @chris-spann,

Thanks so much for your contribution! ⭐

I think we'll want to add support explicitly for the __doc__ argument to the create_model function by modifying the signature of the create_model function in main.py and assigning the docstring of the new class within the create_model function as well.

Please update 👍

@pydantic-hooky pydantic-hooky bot added awaiting author revision awaiting changes from the PR author and removed ready for review labels Oct 18, 2023
@pydantic-hooky pydantic-hooky bot assigned chris-spann and unassigned samuelcolvin Oct 18, 2023
@chris-spann
Copy link
Contributor Author

chris-spann commented Oct 18, 2023

Thank you @sydney-runkle for the review! Please let me know if I've adequately addressed your comment in my latest commit. Please review.

@pydantic-hooky pydantic-hooky bot added ready for review and removed awaiting author revision awaiting changes from the PR author labels Oct 18, 2023
@pydantic-hooky pydantic-hooky bot assigned samuelcolvin and unassigned chris-spann Oct 18, 2023
Copy link
Contributor

@sydney-runkle sydney-runkle left a comment

Choose a reason for hiding this comment

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

Hi @chris-spann,

LGTM other than a few small changes I left comments for. Once you add those small changes, I'll approve and merge.

Thanks again for your contribution. This looks great 🌟

@pydantic-hooky pydantic-hooky bot added awaiting author revision awaiting changes from the PR author and removed ready for review labels Oct 18, 2023
@pydantic-hooky pydantic-hooky bot assigned chris-spann and unassigned samuelcolvin Oct 18, 2023
@sydney-runkle
Copy link
Contributor

@chris-spann,

Apologies, you were actually spot on with the work from your second commit. I forgot that we actually don't support docstring inheritance in V2, that was only in V1 (see my comment here).

Your changes look great, I'll merge here in a sec 👍.

@sydney-runkle sydney-runkle removed the awaiting author revision awaiting changes from the PR author label Oct 19, 2023
Copy link
Contributor

@sydney-runkle sydney-runkle left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the contribution! 🎈

@sydney-runkle sydney-runkle merged commit 6a4b329 into pydantic:main Oct 20, 2023
@chris-spann chris-spann deleted the support-doc-in-create-model branch October 20, 2023 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support __doc__ argument in create_model()
3 participants