-
-
Notifications
You must be signed in to change notification settings - Fork 504
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
DictRow should behave like an OrderedDict? #177
Comments
It's a sort of reasonable expectation, yes. If you provide the implementation for it we would merge it to devel. The best way to contribute is to open a feature branch on a github clone. Current devel supports Python from 2.5 to 3.3. The branch should include tests and documentation. I expect the new feature to not slow down the current implementation. |
Dict's are Ordered from 3.6 |
I encountered the same issue when I tried to export csv from a postgres database. I used the first dict row's keys as the csv header and I realized the csv header and the data did not match. At least it worked with python's native sqlite3 adapter when I used sqlite3, i.e., keys of a row and actual data of a row are in the same order. I would like to suggest to change a little bit DictRow#keys implementation as per the following:
Or at least it would be nice to have a method like (For now I made a super class of DictRow that overrides keys() as workaround.) |
You can use |
Thanks for your quick reply, I actually didn't know that but the thing is I do not have a cursor object when I actually process the data. I know this is just our implementation problem but if DictRow has the information of keys I think it would be nice to know the order of the keys too. |
Sure. For the moment you'll have to use your own subclass of |
Originally submitted by: Laurent Fasnacht
I think RowDict should behave like an OrderedDict. In particular, I would expect the following to be True:
The text was updated successfully, but these errors were encountered: