-
Notifications
You must be signed in to change notification settings - Fork 11
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
ValueError: dictionary update sequence element #0 has length 1; 2 is required #11
Comments
I can not reproduce it in my test environment with stantard unittest. This issue seems happens on testing environment with nose. I have investigated a lot of about this bug and I can not reproduce this error in normal test envirnoment (without nose) . |
Adding this made it work. I think someone mentioned it somewhere. I use django-discover-runner.
|
I could predictably reproduce it while using a django environment with multiple database servers (both pg 9.1.9). From a django shell (./manage.py shell), querying one database and then another would cause the issue. ex:
|
I'm going to work on it in few hours. Thanks for all reports! |
I have added some proposed test and I have investigated about it some time and I can not reproduce these errors. Using basic unit testing and with these variables:
And all tests are successful. The problem seems out of djorm-ext-hstore. I would like to help for solve this issue but I don't know how if i can not reproduce it on my environments. (I have this plugin in production in other environments also with tests and all works correctly...) :( |
I confirm that I get this error from time to time on Django 1.5 and latest hstore extension module. |
niwibe, did you try using django-discover-runner? It might not be this module's fault, but at least that would help determine what is happening. |
I currently use django-discover-runner in other project with djorm-ext-hstore successful. Are you put djorm-ext-core as installed app? Without it, this extension does not works ... |
https://github.com/niwibe/djorm-ext-hstore/blob/master/testing/settings.py#L33 this line is mandatory for make hstore extension works properly... |
Hi niwibe, As the instructions don't mention adding 'djorm_core', 'djorm_expressions', and 'djorm_hstore' to INSTALLED_APPS, I hadn't taken that step. Thanks for clarifying that -- I'll test this against my environment. |
I added This didn't change anything. Are they supposed to be listed before/after something? |
Not, the order is not important. Can you make me a simple test project that on your environment does not works? Because on my environments I can not reproduce this error... |
I added the apps and ran syncdb, no avail. I will try to setup a multi server example later today.
|
Hey guys, I'm having the same issue. Looks like DictionaryField gets serialized as a JSON string, but deserialization expects an actual JSON object. So whose fault is it, the serializer's or the deserializer's? |
Please. For solve it I need some test project for reproduce it. On my tests all works fine... See comment: #11 (comment) |
(See #14 for my fix) |
i ran into this today while writing tests for my app and running tests for djorm-hstore fail too, as mentioned in #12. i dug around, added debug output and at first i thought the singleton After setting So i am now wondering why is |
It set to true because in theory it should registred only once. But the strangest thing is that on my environments works perfectly with unique=True... remember, I have been said that I use it on many projects with unique=True and works all fine... :s |
i cannot fully explain it either. i have a seemingly completely similar dev environment on another computer where tests run fine with i think, that it should register once per connection. at least to my limited understanding well, let's apply the patch and see if it helps or hurts anyone else. it should not hurt imho. |
I agree with you! |
i looked at this again last night... i saw, but somehow totally ignored the and i have seen it work with setting the question now is, why does i am not sure how much time i can spend on investigating further, but i think an issue should remain open, to at least track further findings and warn users of the potential problem. |
i think i got it... the in test so the extension is now registerd with the so in my case i did not have "template1" set up on my notebook when i created the test databases and both have different hstore so, what does it mean!? using there needs to be a way to register hstore not per connection, but per database, because databases can have different btw: this came to me while brushing my teeth, which shows once again how important getting up from in front of the screen is for solving problems :) |
A lot of thanks for your research. And yeah, these ideas often appear in the shower jeje. |
I think there is another thing with unique=True and multiple databases, when only some of them use hstore. So when first connection is made to hstore-less databases, hstore is not registered altogether - unique handler is wasted doing nothing: https://github.com/niwibe/djorm-ext-hstore/blob/master/djorm_hstore/models.py#L98 |
Seeing this issue:
https://github.com/niwibe/django-orm-extensions/issues/19
Using djorm-ext-hstore 0.4.3
pg 9.1.9
django 1.4.3
It's very sporadic and unpredictable.
The text was updated successfully, but these errors were encountered: