plotly / dash-table

OBSOLETE: now part of https://github.com/plotly/dash
https://dash.plotly.com
MIT License
420 stars 72 forks source link

Fix pandas orient arg (to_dict("rows") -> to_dict("records")) #861

Closed wbrgss closed 3 years ago

wbrgss commented 3 years ago

Description of Changes Similar to https://github.com/plotly/dash-docs/pull/1058, changes the incorrect "rows" argument to the parameter orient to the equivalent "records".

Fixes a warning; to_dict('rows') causes the following on pandas 1.1.5:

Using short name for 'orient' is deprecated. Only the options: ('dict', list, 'series', 'split', 'records', 'index') will be used in a future version. Use one of the above to silence this warning.

See https://github.com/plotly/dash-docs/commit/07ac6fcd8a711a1abfeef6d7bdb1f883f17684cc for a description of how this got mixed up:

rows “happens” to work because pandas only looks at the first letter (“r”)


I also blackened some Selenium tests, as black 18.6b4 (the version in this repo's requirements.txt) complained on the husky pre-commit. I also added two directories to the black --exclude option, as I had a (non-hidden/dotfile) venv folder, as suggested in this repo's CONTRIBUTING.md, and I got

error: cannot format /home/plotly/Workspace/dash-table/dash_table_base/__init__.py: 
All done! 💥 💔 💥
27 files would be left unchanged, 1 file would **fail** to reformat.

(** emphasis added)

when running git commit (i.e. black on the pre-commit) without excluding dash_table_base. cc @Marc-Andre-Rivet because these tests haven't been modified for ~10 months, so it might be a difference in my environment...