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

Schema Models for SeriesSchema #1009

Closed
fcarpentey75012 opened this issue Nov 6, 2022 · 2 comments
Closed

Schema Models for SeriesSchema #1009

fcarpentey75012 opened this issue Nov 6, 2022 · 2 comments
Labels
question Further information is requested

Comments

@fcarpentey75012
Copy link

Hello,

I would like to create an Schema Models for an Series, do you have an example to convert this example :

https://pandera.readthedocs.io/en/stable/series_schemas.html

import pandas as pd
import pandera as pa


# specify multiple validators
schema = pa.SeriesSchema(
    str,
    checks=[
        pa.Check(lambda s: s.str.startswith("foo")),
        pa.Check(lambda s: s.str.endswith("bar")),
        pa.Check(lambda x: len(x) > 3, element_wise=True)
    ],
    nullable=False,
    unique=False,
    name="my_series")

validated_series = schema.validate(
    pd.Series(["foobar", "foobar", "foobar"], name="my_series"))
print(validated_series)

Into an Schema Models class ?

Thank you,

@fcarpentey75012 fcarpentey75012 added the question Further information is requested label Nov 6, 2022
@cosmicBboy
Copy link
Collaborator

hi @fcarpentey75012 this is currently not supported. #688 describes an approach to add SeriesModel/ArrayModel to the class-based API, it's not currently prioritized due to core internals overhaul work: #913. Will revisit this once that is completed

@cosmicBboy
Copy link
Collaborator

closing this in favor of #688, please feel free to comment on that issue if you have stuff to add!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants