Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrockmendel committed Nov 29, 2023
1 parent e9d46c5 commit b27f20a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
5 changes: 1 addition & 4 deletions pandas/tests/io/excel/test_writers.py
Original file line number Diff line number Diff line change
Expand Up @@ -858,10 +858,7 @@ def test_to_excel_multiindex_dates(self, merge_cells, path):
unit = "us"
if path.endswith(".ods"):
unit = "s"
new_index = [
tsframe.index.as_unit(unit),
np.arange(len(tsframe.index), dtype=np.int64),
]
new_index[0] = tsframe.index.as_unit(unit)
tsframe.index = MultiIndex.from_arrays(new_index)

tsframe.index.names = ["time", "foo"]
Expand Down
5 changes: 2 additions & 3 deletions pandas/tests/io/json/test_pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -1630,9 +1630,8 @@ def test_read_timezone_information(self):
result = read_json(
StringIO('{"2019-01-01T11:00:00.000Z":88}'), typ="series", orient="index"
)
expected = Series(
[88], index=DatetimeIndex(["2019-01-01 11:00:00"], tz="UTC").as_unit("ns")
)
exp_dti = DatetimeIndex(["2019-01-01 11:00:00"], dtype="M8[ns, UTC]")
expected = Series([88], index=exp_dti)
tm.assert_series_equal(result, expected)

@pytest.mark.parametrize(
Expand Down
6 changes: 3 additions & 3 deletions pandas/tests/reshape/test_pivot.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,10 +437,10 @@ def test_pivot_no_values(self):
index=idx,
)
res = df.pivot_table(index=df.index.month, columns=Grouper(key="dt", freq="ME"))
exp_columns = MultiIndex.from_tuples(
[("A", pd.Timestamp("2011-01-31").as_unit("ns"))]
exp_columns = MultiIndex.from_arrays(
[["A"], pd.DatetimeIndex(["2011-01-31"], dtype="M8[ns]")],
names=[None, "dt"],
)
exp_columns.names = [None, "dt"]
exp = DataFrame(
[3.25, 2.0], index=Index([1, 2], dtype=np.int32), columns=exp_columns
)
Expand Down

0 comments on commit b27f20a

Please sign in to comment.