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

Incomplete support for SQLAlchemy types #23

Open
jimbobhickville opened this issue Aug 20, 2016 · 5 comments
Open

Incomplete support for SQLAlchemy types #23

jimbobhickville opened this issue Aug 20, 2016 · 5 comments

Comments

@jimbobhickville
Copy link

Running into this error with a postgres numeric type which leverages decimal.Decimal under the hood:

TypeError: Decimal('1.6') is not JSON serializable

I think I see how to add it, so I'll put up a PR if I'm successful.

jimbobhickville pushed a commit to jimbobhickville/sqlalchemy-jsonapi that referenced this issue Aug 20, 2016
SQLa Numeric types get returned as decimal.Decimal
objects. simplejson has support for this, whereas
the builtin json module does not and there's no clean
way to subclass it in a way that it won't convert
the value to a JSON string.

Fixes ColtonProvias#23
jimbobhickville pushed a commit to jimbobhickville/sqlalchemy-jsonapi that referenced this issue Aug 20, 2016
SQLa Numeric types get returned as decimal.Decimal
objects. simplejson has support for this, whereas
the builtin json module does not and there's no clean
way to subclass it in a way that it won't convert
the value to a JSON string.

Fixes ColtonProvias#23
jimbobhickville pushed a commit to jimbobhickville/sqlalchemy-jsonapi that referenced this issue Aug 20, 2016
SQLa Numeric types get returned as decimal.Decimal
objects. simplejson has support for this, whereas
the builtin json module does not and there's no clean
way to subclass it in a way that it won't convert
the value to a JSON string.

Fixes ColtonProvias#23
@jimbobhickville
Copy link
Author

So I have a fix, but I had to go back a dozen commits or so to find a commit that wasn't broken to branch from. Any chance you can put the unfinished stuff into a separate branch and get master back in a clean state so I can submit a proper PR and get this fix released?

@ColtonProvias
Copy link
Owner

I just branched the 4.x.x branch off so you can submit the fix to there.

@jimbobhickville
Copy link
Author

Thanks, I'll update my branch and get a PR up later tonight.

jimbobhickville pushed a commit to jimbobhickville/sqlalchemy-jsonapi that referenced this issue Aug 27, 2016
SQLa Numeric types get returned as decimal.Decimal
objects. simplejson has support for this, whereas
the builtin json module does not and there's no clean
way to subclass it in a way that it won't convert
the value to a JSON string.

Fixes ColtonProvias#23
@jimbobhickville
Copy link
Author

Ok, it ended up being a few days before I could get to it, but PR is up now.

@vilka95
Copy link

vilka95 commented Nov 17, 2017

I have a similar issue with Data type. any advice on how to handle that, please?

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

3 participants