Skip to content

Conversation

jbrockmendel
Copy link
Member

Also TDI.insert trying to parse strings to Timedelta, which neither DTI nor PI do.

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

some followon comments

class TestDatetimeIndex:
@pytest.mark.parametrize("null", [None, np.nan, pd.NaT])
@pytest.mark.parametrize(
"null", [None, np.nan, np.datetime64("NaT"), pd.NaT, pd.NA]
Copy link
Contributor

Choose a reason for hiding this comment

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

should create a fixture like this (similar to nulls_fixture), but this is more datetime specialized, but for another pass.

res = idx.insert(0, null)
tm.assert_index_equal(res, expected)

@pytest.mark.parametrize("tz", [None, "UTC", "US/Eastern"])
Copy link
Contributor

Choose a reason for hiding this comment

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

try to fixturize at some point (the tzs)

assert result.freq == expected.freq

@pytest.mark.parametrize(
"null", [None, np.nan, np.timedelta64("NaT"), pd.NaT, pd.NA]
Copy link
Contributor

Choose a reason for hiding this comment

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

similar to above

@jreback jreback added Bug Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate labels Jan 6, 2020
@jreback jreback added this to the 1.0 milestone Jan 6, 2020
@jreback jreback added the Timedelta Timedelta data type label Jan 6, 2020
@jreback jreback merged commit b1e77f9 into pandas-dev:master Jan 6, 2020
@jreback
Copy link
Contributor

jreback commented Jan 6, 2020

thanks (technically should have a whatsnew, but this is a very very tiny edge case), but if you can in a followon ok.

@jbrockmendel jbrockmendel deleted the ref-insert2 branch January 7, 2020 01:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate Timedelta Timedelta data type

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants