Open
Description
I have a use case where I'd like to use Python
integer values within my Cosmos DB table. When the integer values exceed the size allotted to an EdmType.INT32, I receive errors.
Since Python
isn't bound to the same size limitations for its integers, can we get a more appropriate "_to_entity" function for handling Python int
s?
I would propose this:
def _to_entity_int(value):
int_value = int(value)
if int_value >= 2**63 or int_value < -(2**63):
raise TypeError(_ERROR_VALUE_TOO_LARGE.format(str(int_value), EdmType.INT64))
if int_value >= 2**31 or int_value < -(2**31):
return EdmType.INT64, str(value)
else:
return None, value
Thank you so much!