-
-
Notifications
You must be signed in to change notification settings - Fork 311
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
Adding "empty" method to DataFrameSchema and SchemaModel #1039
base: main
Are you sure you want to change the base?
Conversation
disabled mypy so that I could commit/push, main is broken for me right now since 5aa7795
Changes to the pre-commit config needs to be fixed before a merge of course. |
pandera.dtypes.DataType, | ||
pandera.engines.numpy_engine.DataType, | ||
pandera.engines.pandas_engine.DataType, | ||
# these fail when trying to make columns from them, but probably shouldn't |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to remove all exceptions that aren't *.Datatype
, might be tough for those where pandera.Column(...)
doesn't work though -- given that that's how pandera.Column
is supposed to be used.
@@ -521,6 +521,12 @@ def __modify_schema__(cls, field_schema): | |||
"""Update pydantic field schema.""" | |||
field_schema.update(to_json_schema(cls.to_schema())) | |||
|
|||
@classmethod | |||
@docstring_substitution(validate_doc=DataFrameSchema.empty.__doc__) | |||
def empty(cls: Type[TSchemaModel]) -> DataFrame[TSchemaModel]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not too sure DataFrame
is the right return type here - I thought that the signature would be the same as validate
, but pycharm kept complaining, and I couldn't run mypy to make sure.
@a-recknagel (btw do you have feel free to add |
They are installed. Yeah, getting details with types right is a lot of work 😓 |
Signed-off-by: Arne Recknagel <recknagel@auxmoney.com>
2b22026
to
1ad2023
Compare
No description provided.