Skip to content
Snippets Groups Projects
Commit 90708c2f authored by Joana Plewnia's avatar Joana Plewnia
Browse files

added support for long in aron also for python

parent 0013e819
No related branches found
No related tags found
No related merge requests found
Pipeline #22474 passed
......@@ -29,11 +29,18 @@ def pythonic_to_aron_ice(
elif isinstance(value, np.int64):
return AronDataIceTypes.long(int(value))
elif isinstance(value, int) or isinstance(value, np.int32):
# because python is treating int and long the same, we need to differentiate between the two
assert(isinstance(value, int)), value
assert 'invalid value - expected int' not in str(AronIceTypes.int(int(value))), \
f'Casting {value} to int failed. Did you intend to use np.int64 instead, ' \
'but assigned a plain int value, or converted the value somewhere in the meantime?'
return AronIceTypes.int(int(value))
if 'invalid value - expected int' in str(AronIceTypes.int(int(value))):
assert 'invalid value - expected int' not in str(AronIceTypes.long(int(value))), \
f'Casting {value} to long failed. Did you intend to use np.int64 instead, ' \
'but assigned a plain int value, or converted the value somewhere in the meantime?'
return AronIceTypes.long(int(value))
else:
assert 'invalid value - expected int' not in str(AronIceTypes.int(int(value))), \
f'Casting {value} to int failed. Did you intend to use np.int64 instead, ' \
'but assigned a plain int value, or converted the value somewhere in the meantime?'
return AronIceTypes.int(int(value))
elif isinstance(value, np.float64):
return AronDataIceTypes.double(float(value))
elif isinstance(value, float) or isinstance(value, np.float32):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment