-
-
Notifications
You must be signed in to change notification settings - Fork 361
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
A clear and concise description of what the bug is.
- [ x] I have checked that this issue has not already been reported.
- [ x] I have confirmed this bug exists on the latest version of pandera.
- (optional) I have confirmed this bug exists on the main branch of pandera.
Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.
Code Sample, a copy-pastable example
class A(pa.pandas.DataFrameModel):
c: float = pa.pandas.Field(alias="B", coerce=True)
@pa.pandas.parser("B")
my_parser(cls, series: pd.Series) -> Series:
assert False
return series
Expected behavior
Above code never invokes my_parser since coerce=True
. However the parser can perform effects or manipulations that are independent of the typecast presumed by coerce=True
. If coercion is a special case of parsing, then I would expect the parser to take precedence of the coerce flag, instead of the other way around.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working