Skip to content

JSON import and export messes up column ordering #255

Description

@punchagan
data = tablib.Dataset(('John', 'Doe', '10'), headers=['fname', 'lname', 'age'])
print(data, data.json, tablib.import_set(data.json), sep='\n\n##############\n\n')
fname|lname|age
-----|-----|---
John |Doe  |10 

##############

[{"fname": "John", "lname": "Doe", "age": "10"}]

##############

fname|age|lname
-----|---|-----
John |10 |Doe  

This was actually detected before in the failing tests in #149 and it was fixed by fixing the tests. I would expect users to at least be warned about this, if it cannot be fixed with reasonable effort.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions