Skip to content

Conversation

Viicos
Copy link
Member

@Viicos Viicos commented May 1, 2025

Change Summary

Fixes #11816, closes #11818.

Related issue number

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

Viicos added 3 commits May 1, 2025 10:05
- Rename function to `is_stdlib_dataclass()`
- Instead of hacking around with annotations, check the
  cls' `__dict__`
- Update docstring, return type
Explicitly add support for converting stdlib dataclasses
Markup fixes
Simplify example
@github-actions github-actions bot added the relnotes-fix Used for bugfixes. label May 1, 2025
Copy link
Contributor

hyperlint-ai bot commented May 1, 2025

PR Change Summary

Updated the documentation for Pydantic's dataclasses to clarify usage and improve examples.

  • Corrected the syntax for the Pydantic dataclass decorator in examples.
  • Enhanced examples to demonstrate the integration of stdlib dataclasses with Pydantic.
  • Clarified the functionality of the rebuild_dataclass() method.

Modified Files

  • docs/concepts/dataclasses.md

How can I customize these reviews?

Check out the Hyperlint AI Reviewer docs for more information on how to customize the review.

If you just want to ignore it on this PR, you can add the hyperlint-ignore label to the PR. Future changes won't trigger a Hyperlint review.

Note specifically for link checks, we only check the first 30 links in a file and we cache the results for several hours (for instance, if you just added a page, you might experience this). Our recommendation is to add hyperlint-ignore to the PR to ignore the link check for this PR.

@Viicos Viicos requested a review from DouweM May 1, 2025 08:08
Copy link

Deploying pydantic-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: f90cacd
Status: ✅  Deploy successful!
Preview URL: https://6529be49.pydantic-docs.pages.dev
Branch Preview URL: https://dataclass-sub.pydantic-docs.pages.dev

View logs

Copy link
Contributor

github-actions bot commented May 1, 2025

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  pydantic
  dataclasses.py
  json_schema.py
  pydantic/_internal
  _dataclasses.py
Project Total  

This report was generated by python-coverage-comment-action

Copy link

codspeed-hq bot commented May 1, 2025

CodSpeed Performance Report

Merging #11822 will not alter performance

Comparing dataclass-sub (f90cacd) with main (477e67c)

Summary

✅ 46 untouched benchmarks

Copy link
Contributor

@DouweM DouweM left a comment

Choose a reason for hiding this comment

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

LGTM!

@Viicos Viicos merged commit 0d33ece into main May 1, 2025
66 checks passed
@Viicos Viicos deleted the dataclass-sub branch May 1, 2025 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relnotes-fix Used for bugfixes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Overriding defaults behaves differently when using pydantic's dataclass
2 participants