Skip to content
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

DataFrame validation on initiation failed to raise error #1864

Closed
1 task
Zionett opened this issue Nov 22, 2024 · 1 comment
Closed
1 task

DataFrame validation on initiation failed to raise error #1864

Zionett opened this issue Nov 22, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Zionett
Copy link

Zionett commented Nov 22, 2024

Describe the bug
Dataframe validation on initiation fail to raise schema error for data that is of the wrong type or wrong value range. This does not happen in version 0.20.4

  • [ 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

Slightly modified from example in docs https://pandera.readthedocs.io/en/stable/dataframe_models.html#validate-on-initialization

python version 3.11.10

import pandera as pa

from pandera.typing import DataFrame, Series


class Schema(pa.DataFrameModel):
    state: Series[str]
    city: Series[str]
    price: Series[int] = pa.Field(in_range={"min_value": 5, "max_value": 20})

DataFrame[Schema](
    {
        'state': [100,'FL','GA','CA'],
        'city': ['New York', 'Miami', 'Atlanta', 'San Francisco'],
        'price': [800, 12, 10, 16],
    }
)

print('Passed')

Expected behavior

SchemaError raised due to wrong type in 'state' column, or wrong value range in 'price' column

Desktop (please complete the following information):

  • OS: Ubuntu
  • Browser: firefox
  • Version: 0.21.0
@Zionett Zionett added the bug Something isn't working label Nov 22, 2024
@Zionett
Copy link
Author

Zionett commented Nov 22, 2024

Oops, duplicate of #1859

@Zionett Zionett closed this as completed Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant