Commit b8c6606
Preserve column order in YAML export
yaml.safe_dump sorts mapping keys alphabetically by default, so YAML export
reordered columns (e.g. apple, id, name, zebra) inconsistently with the CSV and
JSON exports, which keep the dataset's header order.
Pass sort_keys=False when dumping the dataset and databook so YAML keeps the
original column order.
Fixes #287
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 7503651 commit b8c6606
2 files changed
Lines changed: 20 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
18 | 21 | | |
19 | 22 | | |
20 | 23 | | |
21 | 24 | | |
22 | 25 | | |
23 | 26 | | |
24 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
25 | 31 | | |
26 | 32 | | |
27 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1709 | 1709 | | |
1710 | 1710 | | |
1711 | 1711 | | |
1712 | | - | |
1713 | | - | |
1714 | | - | |
1715 | | - | |
| 1712 | + | |
| 1713 | + | |
| 1714 | + | |
| 1715 | + | |
1716 | 1716 | | |
1717 | 1717 | | |
1718 | 1718 | | |
1719 | 1719 | | |
| 1720 | + | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
1720 | 1728 | | |
1721 | 1729 | | |
1722 | 1730 | | |
| |||
0 commit comments