We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
SchemaModel does not support annotations without a data type, which is supported by DataFrameSchema.
SchemaModel
DataFrameSchema
import pandera as pa pa.DataFrameSchema({"a": pa.Column()}) # works #> <Schema DataFrameSchema(columns={'a': <Schema Column(name=a, type=None)>}, checks=[], index=None, coerce=False, pandas_dtype=None,strict=False,name=None,ordered=False)> class Schema(pa.SchemaModel): column_a: pa.typing.Series Schema.to_schema() #> Traceback (most recent call last): #> <ipython-input-6-87d3c11c1990> in <module> #> ----> 1 Schema.to_schema() #> XX/pandera/pandera/model.py in to_schema(cls) #> 195 cls.__dataframe_checks__ = df_custom_checks + df_registered_checks #> 196 #> --> 197 columns, index = cls._build_columns_index( #> 198 cls.__fields__, cls.__checks__, **mi_kwargs #> 199 ) #> ~XX/model.py in _build_columns_index(cls, fields, checks, **multiindex_kwargs) #> 319 indices.append(index) #> 320 else: #> --> 321 raise SchemaInitError( #> 322 f"Invalid annotation '{field_name}: {annotation.raw_annotation}'" #> 323 ) #> SchemaInitError: Invalid annotation 'column_a: <class 'pandera.typing.Series'>'
SchemaModel should match the DataFrameSchema API and the data type should be optional.
The text was updated successfully, but these errors were encountered:
hey @jeffzi I don't think this addresses the question in #521... tho I think it would be a nice feature to have, so feel free to make a PR for it!
Sorry, something went wrong.
@jeffzi FYI #594 added support for the any type, it probably still makes sense to support an empty pa.typing.Series type, so this issue is still valid
pa.typing.Series
Fixed by #602
jeffzi
No branches or pull requests
SchemaModel
does not support annotations without a data type, which is supported byDataFrameSchema
.Code Sample, a copy-pastable example
Expected behavior
SchemaModel
should match theDataFrameSchema
API and the data type should be optional.The text was updated successfully, but these errors were encountered: