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

FlexEntity.flatten() will convert unknown types to str #19

Open
six8 opened this issue Sep 8, 2018 · 0 comments
Open

FlexEntity.flatten() will convert unknown types to str #19

six8 opened this issue Sep 8, 2018 · 0 comments
Labels

Comments

@six8
Copy link
Collaborator

six8 commented Sep 8, 2018

It should unknown types intact. Converting to str could be an encoding issue for unicode-like values. Values that are already Python types such as UUID should stay a UUID.

Instead, fields.get_field_for_type(val) should be used instead to guess the best type for the value.

https://github.com/six8/springfield/blame/develop/src/springfield/entity.py#L356

        elif not isinstance(val, (basestring, int, float, long)):
            val = str(val)

@six8 six8 added the Bug label Sep 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant