BUG: yaml.dump(DataFrame)
- [x] closes #42748
- [x] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them
- [x] whatsnew entry

Looks good overall. I'm not sure if the test is being run in CI, though(I'm not seeing pyyaml in the CI dependencies). 

Also, it would be nice to backport to 1.3.x, but its fine if it can't be. > Looks good overall. I'm not sure if the test is being run in CI, though(I'm not seeing pyyaml in the CI dependencies).
> 
> Also, it would be nice to backport to 1.3.x, but its fine if it can't be.

Yeah agree, will be being run in the Data Manager Tests (since that just uses environment.yml) https://github.com/pandas-dev/pandas/runs/3969868404?check_suite_focus=true -> but might be better to move elsewhere since these are experimental..  thanks @jbrockmendel if you want to attempt to backport ok by me (would involve also moving the note in master).