Skip to content

Commit 059742b

Browse files
ShaharNavehWillAyd
authored andcommitted
TYP: Type annotations in pandas/io/formats/style.py (#30403)
1 parent cd7c784 commit 059742b

File tree

2 files changed

+142
-86
lines changed

2 files changed

+142
-86
lines changed

pandas/io/formats/excel.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1-
"""Utilities for conversion to writer-agnostic Excel representation
1+
"""
2+
Utilities for conversion to writer-agnostic Excel representation.
23
"""
34

45
from functools import reduce
56
import itertools
67
import re
7-
from typing import Callable, Dict, List, Optional, Sequence, Union
8+
from typing import Callable, Dict, Optional, Sequence, Union
89
import warnings
910

1011
import numpy as np
1112

13+
from pandas._typing import Label
14+
1215
from pandas.core.dtypes import missing
1316
from pandas.core.dtypes.common import is_float, is_scalar
1417
from pandas.core.dtypes.generic import ABCMultiIndex, ABCPeriodIndex
@@ -371,10 +374,10 @@ def __init__(
371374
df,
372375
na_rep: str = "",
373376
float_format: Optional[str] = None,
374-
cols: Optional[Sequence] = None,
375-
header: Union[bool, List[str]] = True,
377+
cols: Optional[Sequence[Label]] = None,
378+
header: Union[Sequence[Label], bool] = True,
376379
index: bool = True,
377-
index_label: Union[str, Sequence, None] = None,
380+
index_label: Optional[Union[Label, Sequence[Label]]] = None,
378381
merge_cells: bool = False,
379382
inf_rep: str = "inf",
380383
style_converter: Optional[Callable] = None,

0 commit comments

Comments
 (0)