Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support default factories taking validated data as an argument #10678

Merged
merged 6 commits into from
Oct 24, 2024

Conversation

Viicos
Copy link
Member

@Viicos Viicos commented Oct 21, 2024

Change Summary

Closes #9789
Requires pydantic/pydantic-core#1491

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

@github-actions github-actions bot added the relnotes-fix Used for bugfixes. label Oct 21, 2024
Copy link

cloudflare-workers-and-pages bot commented Oct 21, 2024

Deploying pydantic-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: cf2b4d4
Status: ✅  Deploy successful!
Preview URL: https://e9977517.pydantic-docs.pages.dev
Branch Preview URL: https://dependent-defaults.pydantic-docs.pages.dev

View logs

@Viicos Viicos force-pushed the dependent-defaults branch 2 times, most recently from 7e98130 to ed49703 Compare October 22, 2024 14:10
Copy link

codspeed-hq bot commented Oct 22, 2024

CodSpeed Performance Report

Merging #10678 will not alter performance

Comparing dependent-defaults (cf2b4d4) with main (af32a86)

Summary

✅ 44 untouched benchmarks

@Viicos Viicos force-pushed the dependent-defaults branch 4 times, most recently from d8c3d05 to d5ec070 Compare October 23, 2024 09:53
@Viicos Viicos force-pushed the dependent-defaults branch from fc328aa to 8f6e3d6 Compare October 23, 2024 10:13
Copy link
Contributor

github-actions bot commented Oct 23, 2024

Coverage report

This PR does not seem to contain any modification to coverable code.

@Viicos Viicos force-pushed the dependent-defaults branch from 8f6e3d6 to 78a8a57 Compare October 23, 2024 10:23
@Viicos Viicos marked this pull request as ready for review October 23, 2024 10:25
@Viicos
Copy link
Member Author

Viicos commented Oct 23, 2024

I haven't documented the exclude_defaults behavior as it seems pretty niche

pdm.lock Outdated Show resolved Hide resolved
Copy link
Member

@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.

Nice work! One minor question.

Thanks for adding the section to the concepts docs, looks great.

pydantic/_internal/_utils.py Show resolved Hide resolved
pydantic/fields.py Show resolved Hide resolved
@Viicos Viicos enabled auto-merge (squash) October 24, 2024 19:30
@Viicos Viicos merged commit 12f89be into main Oct 24, 2024
54 checks passed
@Viicos Viicos deleted the dependent-defaults branch October 24, 2024 19:37
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.

Allow access to other field values when creating a default value
2 participants