-
Notifications
You must be signed in to change notification settings - Fork 143
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
HStoreDict does not convert long integers to strings. #60
Comments
Also, I haven't looked much into the new Schema Mode yet, but isn't the if statement at https://github.com/djangonauts/django-hstore/blob/1.3.0/django_hstore/dict.py#L120 the wrong way around? Isn't converting everything to a string the right thing to do exactly when there is no schema? |
@mattiaslinnap there's a whole block of comments, if you read it you will understand why it is coded that way. |
should be fixed, let us know. |
Python "long" integers are not converted to strings by HStoreDict.ensure_acceptable_value(). Usual integers are silently promoted to infinite-sized long integers by Python, and surprisingly long is not a subclass of int.
This can eventually result in a mixed string and integer PostgreSQL array being passed to the hstore() constructor, and PostgreSQL complaining about strings not being integers.
A proposed fix is to add "long" to the list of types in https://github.com/djangonauts/django-hstore/blob/1.3.0/django_hstore/dict.py#L123
The text was updated successfully, but these errors were encountered: