412554b2f06f3782c9336f5a4dfc5bb890219afd,pandas/tests/indexing/test_coercion.py,TestInsertIndexCoercion,test_insert_index_timedelta64,#TestInsertIndexCoercion#,466
Before Change
)
// ToDo: must coerce to object
msg = "value should be a "Timedelta" or "NaT". Got "Timestamp" instead."
with pytest.raises(TypeError, match=msg):
obj.insert(1, pd.Timestamp("2012-01-01"))
// ToDo: must coerce to object
msg = "value should be a "Timedelta" or "NaT". Got "int" instead."
with pytest.raises(TypeError, match=msg):
obj.insert(1, 1)
After Change
result = obj.insert(1, item)
expected = obj.astype(object).insert(1, item)
assert expected.dtype == object
tm.assert_index_equal(result, expected)
@pytest.mark.parametrize(
"insert, coerced_val, coerced_dtype",
[
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: pandas-dev/pandas
Commit Name: 412554b2f06f3782c9336f5a4dfc5bb890219afd
Time: 2021-01-21
Author: jbrockmendel@gmail.com
File Name: pandas/tests/indexing/test_coercion.py
Class Name: TestInsertIndexCoercion
Method Name: test_insert_index_timedelta64
Project Name: pandas-dev/pandas
Commit Name: 412554b2f06f3782c9336f5a4dfc5bb890219afd
Time: 2021-01-21
Author: jbrockmendel@gmail.com
File Name: pandas/tests/indexes/timedeltas/test_insert.py
Class Name: TestTimedeltaIndexInsert
Method Name: test_insert_invalid_na
Project Name: pandas-dev/pandas
Commit Name: 412554b2f06f3782c9336f5a4dfc5bb890219afd
Time: 2021-01-21
Author: jbrockmendel@gmail.com
File Name: pandas/tests/indexes/datetimes/test_insert.py
Class Name: TestInsert
Method Name: test_insert_invalid_na