|
9 | 9 |
|
10 | 10 | from pandas.errors import CSSWarning |
11 | 11 |
|
12 | | -from pandas import ( |
13 | | - DataFrame, |
14 | | - MultiIndex, |
15 | | - Timestamp, |
16 | | - period_range, |
17 | | - to_datetime, |
18 | | -) |
19 | 12 | import pandas._testing as tm |
20 | 13 |
|
21 | 14 | from pandas.io.formats.excel import ( |
@@ -435,35 +428,3 @@ def test_css_excel_cell_cache(styles, cache_hits, cache_misses): |
435 | 428 |
|
436 | 429 | assert cache_info.hits == cache_hits |
437 | 430 | assert cache_info.misses == cache_misses |
438 | | - |
439 | | - |
440 | | -def test_format_hierarchical_rows_with_periodindex(): |
441 | | - # GH#60099 |
442 | | - period_index = period_range(start="2006-10-06", end="2006-10-07", freq="D") |
443 | | - df = DataFrame({"A": [0, 0]}, index=period_index) |
444 | | - converter = CSSToExcelConverter() |
445 | | - cells: list[CssExcelCell] = list(converter._format_hierarchical_rows(df)) |
446 | | - for cell in cells: |
447 | | - assert isinstance(cell.val, Timestamp), "Expected cell value to be a Timestamp" |
448 | | - assert cell.val in to_datetime( |
449 | | - ["2006-10-06", "2006-10-07"] |
450 | | - ), "Unexpected cell value" |
451 | | - |
452 | | - |
453 | | -def test_format_hierarchical_rows_with_period(): |
454 | | - # GH#60099 |
455 | | - period_index = period_range(start="2006-10-06", end="2006-10-07", freq="D") |
456 | | - number_index = ["1", "2"] |
457 | | - df = DataFrame( |
458 | | - {"A": [0, 0]}, index=MultiIndex.from_arrays([period_index, number_index]) |
459 | | - ) |
460 | | - converter = CSSToExcelConverter() |
461 | | - cells: list[CssExcelCell] = list(converter._format_hierarchical_rows(df)) |
462 | | - for cell in cells: |
463 | | - if cell.css_col == 0: |
464 | | - assert isinstance( |
465 | | - cell.val, Timestamp |
466 | | - ), "Expected cell value to be a Timestamp" |
467 | | - assert cell.val in to_datetime( |
468 | | - ["2006-10-06", "2006-10-07"] |
469 | | - ), "Unexpected cell value" |
0 commit comments