feat(pandas): add Series and DataFrame extra types#383
Closed
RedZapdos123 wants to merge 2 commits intopydantic:mainfrom
Closed
feat(pandas): add Series and DataFrame extra types#383RedZapdos123 wants to merge 2 commits intopydantic:mainfrom
RedZapdos123 wants to merge 2 commits intopydantic:mainfrom
Conversation
Signed-off-by: Mridankan Mandal <xerontitan90@gmail.com>
Signed-off-by: Mridankan Mandal <xerontitan90@gmail.com>
Contributor
Author
|
Note: Most of the 713 added lines come from uv.lock, which is the auto-generated dependency lockfile. uv.lock expanded because adding pandas/pandas-stubs introduced numpy resolution data with many wheel/hash entries across Python, and platform targets, and uv also refreshed resolution markers. This repository uses uv frozen workflows in Makefile and CI, so committing uv.lock updates is needed for reproducible installs, and the stable CI. Thank you to the maintainers who are reviewing this. |
Member
|
This would require more discussion and more upvotes to the issue (this PR is pretty barebones and does not validate generic parameters). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Issue #64 stayed open because PR #68 did not land a stable validator/schema design for pandas support. The previous approach centered on a custom wrapper pattern that maintainers asked to revisit. This PR implements dedicated pandas extra types with core-schema validation only, without a custom
__init__flow.The change adds Series and DataFrame support in pydantic_extra_types.pandas, wires pandas>=2.0.0 as an optional dependency, and adds regression tests that cover validation paths, schema generation, and JSON serialization behavior.
Closes #64
Checklist:
The screenshot of the full test suite run, for validation (ran on WSL):
An example run: