Closed smackesey closed 2 years ago
Hi @smackesey
You need to set the config name
, similarly to DataFrameSchema(..., name=...)
import pandera as pa
class SampleSchemaModel(pa.SchemaModel):
foo: pa.typing.Series[int] = pa.Field()
class Config:
name = "SampleSchemaModel"
SampleSchemaModel.to_schema().name
#> 'SampleSchemaModel'
We try to have feature parity between SchemaModel and DataFrameSchema, but I do think it makes sense to use class name for SchemaModel. At worst, people do not use the name and are unaffected by a change.
Pinging @cosmicBboy for approval :)
I think using the SchemaModel
class name makes sense as a fallback... specifying a name explicitly in the Config
should override it... what do y'all think?
fixed by #761
This seems unintuitive to me-- I'd expect the class name of the schema model to be propagated as the
name
of theDataFrameSchema
. Is this intended behavior or an oversight?