I am trying to check if a floating column is actually an int column before converting it to string column, (exact use case: 123.00 needs to be 123, '123-4' needs to remain '123-4').
Code:
# series: modin pandas Series
try:
# If it's a int (123.0)
return series.astype(int).astype(str)
except Exception:
# If it's a string (12-3)
return series.astype(str)
However, the exception is not caught
ValueError: invalid literal for int() with base 10: '123-4'
ray.exceptions.RayTaskError(ValueError): ray::apply_func()
I have tried with except:
, except ValueError:
,
from ray.exceptions import RayTaskError
except RayTaskError:
Update: Present as a github issue: https://github.com/modin-project/modin/issues/3966