pandera icon indicating copy to clipboard operation
pandera copied to clipboard

From DataFrameSchema to SchemaModel?

Open bukosabino opened this issue 2 years ago • 2 comments

Question about pandera

Hi all, how can I convert a DataFrameSchema to a SchemaModel (Pydantic style)?

Also, any option to generate the SchemaModel using infer_schema?

Thanks

bukosabino avatar Feb 02 '22 20:02 bukosabino

Hi @bukosabino, yes! this is an open issue https://github.com/pandera-dev/pandera/issues/393.

Would you be open to making a contribution on this front?

cosmicBboy avatar Feb 02 '22 21:02 cosmicBboy

Also, any option to generate the SchemaModel using infer_schema?

Once the DataFrameSchema.to_model method is implemented it should be pretty straightforward to output a SchemaModel from infer_schema.

Another related feature mentioned in #393 would be to support a SchemaModel.to_script method from an inferred schema. This would be a separate PR.

cosmicBboy avatar Feb 02 '22 21:02 cosmicBboy

closing this in to merge with #393

cosmicBboy avatar Aug 11 '22 19:08 cosmicBboy