Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Order of an OrderedDict not preserved #30

Closed
scraperdragon opened this issue Oct 23, 2013 · 1 comment
Closed

Order of an OrderedDict not preserved #30

scraperdragon opened this issue Oct 23, 2013 · 1 comment

Comments

@scraperdragon
Copy link
Contributor

It would be nice if, when passing an OrderedDict to 'insert', the order of the columns was preserved: i.e.

>>> data = collections.OrderedDict([('A', 1), ('B', 2), ('C', 3), ('D', 4)])
>>> mytable.insert(data, ['A', 'B'])
>>> mytable.find_one()[-1:]
[1, 2, 3, 4]

(above from memory, sorry)

Obviously if OrderedDicts with different key orderings are provided, the database wouldn't be able to handle both orders, and should stick with the first.

I'll look deeper into this when I get a moment - was hoping to have a pull request sorted but it's a little more complicated than I expected.

@stefanw
Copy link
Collaborator

stefanw commented Jan 31, 2014

This should be fixed by 8f4cd59. Some set() operations were messing with order. Column keys are now treated as lists.

@stefanw stefanw closed this as completed Jan 31, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants