Skip to content

Type validation context as dict[str, Any] | None #709

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

Merged
merged 1 commit into from
Jul 13, 2023
Merged

Conversation

adriangb
Copy link
Member

@adriangb adriangb commented Jun 28, 2023

Selected Reviewer: @dmontagu

@adriangb
Copy link
Member Author

please review

@codspeed-hq
Copy link

codspeed-hq bot commented Jun 28, 2023

CodSpeed Performance Report

Merging #709 will improve performances by 10.16%

Comparing fix-context-typing (70dd797) with main (0c0e391)

Summary

🔥 1 improvements
✅ 125 untouched benchmarks

Benchmarks breakdown

Benchmark main fix-context-typing Change
🔥 test_arguments 40.7 µs 37 µs +10.16%

@adriangb adriangb force-pushed the fix-context-typing branch from d5c5202 to 4d2e4a7 Compare June 28, 2023 16:03
Copy link
Member

@samuelcolvin samuelcolvin left a comment

Choose a reason for hiding this comment

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

humm, but I thought you could pass whatever you like to context?

@adriangb
Copy link
Member Author

I think you technically can, but it is typed as dict[str, Any] in some places and Any in others. I thought we'd want to encourage dict[str, Any] because it seems better for interop between things in the ecosystem, but I'm happy to unify on Any if you'd prefer.

Copy link
Collaborator

@dmontagu dmontagu left a comment

Choose a reason for hiding this comment

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

I have no objections to this change, but defer to @samuelcolvin if he wants to keep it as an Any. In practice I think this is probably helpful for making sure that different libraries/etc. are forced to play a bit more nicely with each other if they make use of the functionality.

@dmontagu dmontagu assigned samuelcolvin and unassigned dmontagu Jul 3, 2023
@samuelcolvin
Copy link
Member

okay, fine by me. linting is failing, also conflicts, please update.

@adriangb adriangb force-pushed the fix-context-typing branch from 4d2e4a7 to 70dd797 Compare July 13, 2023 14:29
@adriangb adriangb enabled auto-merge (squash) July 13, 2023 14:30
@codecov
Copy link

codecov bot commented Jul 13, 2023

Codecov Report

Merging #709 (d5c5202) into main (0c0e391) will increase coverage by 0.07%.
The diff coverage is 100.00%.

❗ Current head d5c5202 differs from pull request most recent head 70dd797. Consider uploading reports for the commit 70dd797 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #709      +/-   ##
==========================================
+ Coverage   93.66%   93.73%   +0.07%     
==========================================
  Files          99       99              
  Lines       14247    13807     -440     
  Branches       25       25              
==========================================
- Hits        13344    12942     -402     
+ Misses        897      859      -38     
  Partials        6        6              
Impacted Files Coverage Δ
python/pydantic_core/core_schema.py 96.63% <100.00%> (-0.03%) ⬇️

... and 41 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0c0e391...70dd797. Read the comment docs.

@adriangb adriangb merged commit 3345f3e into main Jul 13, 2023
@adriangb adriangb deleted the fix-context-typing branch July 13, 2023 14:35
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.

3 participants