Skip to content

Commit

Permalink
assert Timestamp instead
Browse files Browse the repository at this point in the history
  • Loading branch information
ZKaoChi committed Nov 22, 2024
1 parent 82259d3 commit 192c1b7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion doc/source/whatsnew/v3.0.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -688,10 +688,10 @@ I/O
- Bug in :meth:`DataFrame.from_records` where ``columns`` parameter with numpy structured array was not reordering and filtering out the columns (:issue:`59717`)
- Bug in :meth:`DataFrame.to_dict` raises unnecessary ``UserWarning`` when columns are not unique and ``orient='tight'``. (:issue:`58281`)
- Bug in :meth:`DataFrame.to_excel` when writing empty :class:`DataFrame` with :class:`MultiIndex` on both axes (:issue:`57696`)
- Bug in :meth:`DataFrame.to_excel` where the :class:`MultiIndex` index with a period level was not a date (:issue:`60099`)
- Bug in :meth:`DataFrame.to_stata` when writing :class:`DataFrame` and ``byteorder=`big```. (:issue:`58969`)
- Bug in :meth:`DataFrame.to_stata` when writing more than 32,000 value labels. (:issue:`60107`)
- Bug in :meth:`DataFrame.to_string` that raised ``StopIteration`` with nested DataFrames. (:issue:`16098`)
- Bug in :meth:`ExcelFormatter._format_hierarchical_rows` where output type in excel for multiIndex with period levels is not a date (:issue:`60099`)
- Bug in :meth:`HDFStore.get` was failing to save data of dtype datetime64[s] correctly (:issue:`59004`)
- Bug in :meth:`read_csv` causing segmentation fault when ``encoding_errors`` is not a string. (:issue:`59059`)
- Bug in :meth:`read_csv` raising ``TypeError`` when ``index_col`` is specified and ``na_values`` is a dict containing the key ``None``. (:issue:`57547`)
Expand Down
9 changes: 5 additions & 4 deletions pandas/tests/io/excel/test_style.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from pandas import (
DataFrame,
MultiIndex,
Period,
Timestamp,
period_range,
read_excel,
)
Expand Down Expand Up @@ -355,6 +355,7 @@ def test_format_hierarchical_rows_periodindex(merge_cells):
formatted_cells = formatter._format_hierarchical_rows()

for cell in formatted_cells:
assert not isinstance(
cell.val, Period
), "Period should be converted to Timestamp"
if cell.row != 0 and cell.col == 0:
assert isinstance(
cell.val, Timestamp
), "Period should be converted to Timestamp"

0 comments on commit 192c1b7

Please sign in to comment.