Fixed issue where Pandera cannot handle metadata through Annotated types#2111
Open
NGHades wants to merge 8 commits intounionai-oss:mainfrom
Open
Fixed issue where Pandera cannot handle metadata through Annotated types#2111NGHades wants to merge 8 commits intounionai-oss:mainfrom
NGHades wants to merge 8 commits intounionai-oss:mainfrom
Conversation
> > Co-authored-by: Kevin Jijon <Kevinjijon0@gmail.com> > Co-authored-by: Karan Verma <kverma2750@gmail.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2111 +/- ##
==========================================
- Coverage 83.86% 83.83% -0.04%
==========================================
Files 137 137
Lines 10607 10620 +13
==========================================
+ Hits 8896 8903 +7
- Misses 1711 1717 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Collaborator
|
thanks for the contribution @NGHades ! looks like there are a few failing tests. you can repro this locally using |
3 tasks
ybressler
reviewed
Oct 9, 2025
Comment on lines
+173
to
+174
| if field_info_list: | ||
| existing_field = field_info_list[0] |
Collaborator
There was a problem hiding this comment.
Would be useful to provide an inline comment here, why you're retrieving the first item
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.
Problem
This PR addresses issue #2110, which we (@kevJ711 and @KViruz2750) identified while working with Annotated types in conjunction with pa.Field(...).
Description
When defining schema models using Annotated along with pa.Field(...), metadata such as description, unique, and title was not being correctly propagated into the resulting DataFrameModel.
Solution
We introduced a more rigorous check for parsing Annotated types to ensure that any AnnotationInfo attached to a type is correctly handled and its metadata extracted. This change allows the model to capture and utilize metadata as expected.
Additionally, we observed that certain built-in types (str, int, float, bool) do not support parameterization. To prevent issues when handling these types, we added a check that safely returns an empty metadata dictionary for them.