Skip to content

Conversation

@ciaran-blewitt-webjet
Copy link
Contributor

Some of the data that I have been dealing with had fields that were getting converted to long datatypes by Python, which were getting ignored/throwing an error when attempting to build a schema. This should now return "integer" when a long is passed to the function


t = type(o)
if t == int:
if t == int or t == long:
Copy link
Owner

@tylertreat tylertreat Mar 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't work in python 3 (http://python3porting.com/differences.html#long), which is why CI failed. Probably should do a check using six similar to the one below using six.integer_types (https://pythonhosted.org/six/#six.integer_types).


t = type(o)
if t == int:
if isinstance(t, six.integer_types):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since t is a type, I don't think this is quite right. I believe this just needs to be if t in six.integer_types since six.integer_types is a tuple containing all integer types.

@tylertreat tylertreat merged commit a3348ed into tylertreat:master Mar 7, 2017
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

Successfully merging this pull request may close these issues.

2 participants