simonw / airtable-export

Export Airtable data to YAML, JSON or SQLite files on disk
https://datasette.io/tools/airtable-export
Apache License 2.0
112 stars 15 forks source link

Airtable API may not always return fields in the same order #4

Closed simonw closed 4 years ago

simonw commented 4 years ago

Since fields are returned as nested JSON this is in line with how the JSON spec works.

BUT... the YAML serialization does care about order. So if Airtable's API randomly returns fields in a different order it will produce different YAML, which means if it's being kept in a git repo you'll get a pointless commit - e.g. this one: https://github.com/natbat/rockybeaches/commit/96acfae66b89606e40e1d54fc4059e9744e010a4

simonw commented 4 years ago

Fix is to change sort_keys to True here: https://github.com/simonw/airtable-export/blob/d6113f630182fa5b8f8bd328aa77f4b4033aab0d/airtable_export/cli.py#L42

simonw commented 4 years ago

JSON export in #2 will need to do this too.