pandera
pandera copied to clipboard
Include DataFrameSchema and Column description attribute in serialization
Is your feature request related to a problem? Please describe.
description
attributes are not included when DataFrameSchemas and Columns are serialized for exporting to yaml.
Describe the solution you'd like
Add the description attribute to pandera.io._serialize_schema()
for the DataFrameSchema and its columns.
I'm new to the code base but this seems like the location to tweak for writing new schema information to yaml files.
Describe alternatives you've considered
To access all column descriptions I am currently iterating over each column and pulling out their descriptions. This totally works but I can't think of a reason description
can't be included in the to_yaml()
output.
thanks @bendnorman, please feel free to make a PR for this, the part of the codebase you linked is exactly where the changes need to happen
I needed this too, so I made a PR that tackles this: https://github.com/pandera-dev/pandera/pull/877.
I also serialize the "title" attribute as well.