You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Any plans for this? I'm also running into this problem, I have modular schemas that inherit from eachother and want to add another easy option for 3rd party users to get the yaml info from a schema and be able to see everything in 1 place - its a massive convenience to help adoption
Here's a more simple example without inheritance
importpanderaaspaimportpandera.extensionsasextensions@extensions.register_check_method(statistics=["cls"])defnon_null_values_in_extra_columns(df, cls):
"""This function checks any column not specified in the schema and makes sure that its not null."""# Get the columns defined in the schemadefined_columns=cls.to_schema().columns.keys()
# Find columns in the DataFrame that are not defined in the schemaextra_columns= [colforcolindf.columnsifcolnotindefined_columns]
# Check that all values in these extra columns are not nullreturndf[extra_columns].notnull().all().all()
classTestSchema(pa.DataFrameModel):
@pa.dataframe_checkdefcheck_non_null_values_in_extra_columns(cls, df):
res=pa.Check.non_null_values_in_extra_columns(cls)(df)
returnres.check_passedprint(TestSchema.to_yaml())
the expected behavior would be for the registered method non_null_values_in_extra_columns to show up in the yaml output. If I include the check in the Config it will show up in the yaml output, but there would be no way to reference cls that way, and with inheritance I would have to restate all of the Config settings that were inherited or else they would get overwritten (as far as I can tell, theres no way to append to a config apart from the metadata)
Describe the bug
A clear and concise description of what the bug is.
Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.
Code Sample, a copy-pastable example
Expected behavior
Keep checks rules in yaml so they can be loaded again.
Desktop (please complete the following information):
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: