pandera icon indicating copy to clipboard operation
pandera copied to clipboard

Include DataFrameSchema and Column description attribute in serialization

Open bendnorman opened this issue 2 years ago • 2 comments

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.

bendnorman avatar Mar 30 '22 16:03 bendnorman

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

cosmicBboy avatar Apr 04 '22 02:04 cosmicBboy

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.

dantheand avatar Jun 20 '22 22:06 dantheand