Fix Index mul-like ops with timedelta scalars by jbrockmendel · Pull Request #19333 · pandas-dev/pandas (original) (raw)

What did it turn out to be?

I'll open an issue for the underlying cause because it might cause problems elsewhere: in sufficiently old numpy (the build that caught it used 1.9.2) we see the following:

value = np.timedelta64(86400000000000,'ns')
new_value = int(value)
assert new_value == value  # <-- in older numpy, this does not raise

As a result RangeIndex(np.timedelta64(1, 'ns'), np.timedelta64(10, 'ns'), np.timedelta64(1, 'ns')) doesn't raise and instead returns RangeIndex(1, 10, 1).