Skip to content

Commit bbb33d5

Browse files
committed
TYP: add types to params
1 parent fabec53 commit bbb33d5

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

pandas/core/indexes/base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,9 @@ def format(
924924

925925
return self._format_with_header(header, na_rep=na_rep)
926926

927-
def _format_with_header(self, header, na_rep="NaN") -> List[str_t]:
927+
def _format_with_header(
928+
self, header: List[str_t], na_rep: str_t = "NaN"
929+
) -> List[str_t]:
928930
from pandas.io.formats.format import format_array
929931

930932
values = self._values

pandas/core/indexes/category.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ def _format_attrs(self):
347347
attrs.append(("length", len(self)))
348348
return attrs
349349

350-
def _format_with_header(self, header, na_rep="NaN") -> List[str]:
350+
def _format_with_header(self, header: List[str], na_rep: str = "NaN") -> List[str]:
351351
from pandas.io.formats.printing import pprint_thing
352352

353353
result = [

pandas/core/indexes/datetimelike.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,9 @@ def format(
362362

363363
return self._format_with_header(header, na_rep=na_rep, date_format=date_format)
364364

365-
def _format_with_header(self, header, na_rep="NaT", date_format=None) -> List[str]:
365+
def _format_with_header(
366+
self, header: List[str], na_rep: str = "NaT", date_format: Optional[str] = None
367+
) -> List[str]:
366368
return header + list(
367369
self._format_native_types(na_rep=na_rep, date_format=date_format)
368370
)

pandas/core/indexes/interval.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -948,7 +948,7 @@ def take(self, indices, axis=0, allow_fill=True, fill_value=None, **kwargs):
948948
# Rendering Methods
949949
# __repr__ associated methods are based on MultiIndex
950950

951-
def _format_with_header(self, header, na_rep="NaN") -> List[str]:
951+
def _format_with_header(self, header: List[str], na_rep: str = "NaN") -> List[str]:
952952
return header + list(self._format_native_types(na_rep=na_rep))
953953

954954
def _format_native_types(self, na_rep="NaN", quoting=None, **kwargs):

0 commit comments

Comments
 (0)