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

Extend Flask JSON encoder to handle numpy.floating values #110

Open
rod-glover opened this issue Dec 4, 2019 · 2 comments
Open

Extend Flask JSON encoder to handle numpy.floating values #110

rod-glover opened this issue Dec 4, 2019 · 2 comments

Comments

@rod-glover
Copy link
Contributor

rod-glover commented Dec 4, 2019

There is ample documentation on how to extend the Flask JSON encoder to handle numpy, but it didn't seem to work. Cowboy up.

@jameshiebert
Copy link
Contributor

What's the purpose of this?

@rod-glover
Copy link
Contributor Author

IIRC, it's to prevent having to know which fields require custom, manual conversion. Manual conversion means it has to be maintained when things change, and you can get it wrong. Encoders just know. Flask has a few built-in encoders for common types, but it doesn't know about numpy. IIRC. Should have recorded this all in the original issue.

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