Skip to content

feat(pandas): add Series and DataFrame extra types#383

Closed
RedZapdos123 wants to merge 2 commits intopydantic:mainfrom
RedZapdos123:feat/pandas-types-64
Closed

feat(pandas): add Series and DataFrame extra types#383
RedZapdos123 wants to merge 2 commits intopydantic:mainfrom
RedZapdos123:feat/pandas-types-64

Conversation

@RedZapdos123
Copy link
Copy Markdown
Contributor

@RedZapdos123 RedZapdos123 commented Apr 6, 2026

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:

  • I have reviewed all changes in this PR myself.
  • I have added relevant test cases for this fix.
  • I have run the linting and formatting scripts (make lint).

The screenshot of the full test suite run, for validation (ran on WSL):

image

An example run:

image

Signed-off-by: Mridankan Mandal <xerontitan90@gmail.com>
Signed-off-by: Mridankan Mandal <xerontitan90@gmail.com>
@RedZapdos123
Copy link
Copy Markdown
Contributor Author

RedZapdos123 commented Apr 6, 2026

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.

@Viicos
Copy link
Copy Markdown
Member

Viicos commented Apr 6, 2026

This would require more discussion and more upvotes to the issue (this PR is pretty barebones and does not validate generic parameters).

@Viicos Viicos closed this Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support pandas types

3 participants