|
81 | 81 | if TYPE_CHECKING:
|
82 | 82 | from pandas import Series, DataFrame, Categorical
|
83 | 83 |
|
84 |
| -formatters_type = Union[ |
| 84 | +FormattersType = Union[ |
85 | 85 | List[Callable], Tuple[Callable, ...], Mapping[Union[str, int], Callable]
|
86 | 86 | ]
|
87 |
| -float_format_type = Union[str, Callable, "EngFormatter"] |
| 87 | +FloatFormatType = Union[str, Callable, "EngFormatter"] |
88 | 88 |
|
89 | 89 | common_docstring = """
|
90 | 90 | Parameters
|
@@ -455,7 +455,7 @@ class TableFormatter:
|
455 | 455 |
|
456 | 456 | show_dimensions: Union[bool, str]
|
457 | 457 | is_truncated: bool
|
458 |
| - formatters: formatters_type |
| 458 | + formatters: FormattersType |
459 | 459 | columns: Index
|
460 | 460 |
|
461 | 461 | @property
|
@@ -548,9 +548,9 @@ def __init__(
|
548 | 548 | header: Union[bool, Sequence[str]] = True,
|
549 | 549 | index: bool = True,
|
550 | 550 | na_rep: str = "NaN",
|
551 |
| - formatters: Optional[formatters_type] = None, |
| 551 | + formatters: Optional[FormattersType] = None, |
552 | 552 | justify: Optional[str] = None,
|
553 |
| - float_format: Optional[float_format_type] = None, |
| 553 | + float_format: Optional[FloatFormatType] = None, |
554 | 554 | sparsify: Optional[bool] = None,
|
555 | 555 | index_names: bool = True,
|
556 | 556 | line_width: Optional[int] = None,
|
@@ -1089,7 +1089,7 @@ def _get_column_name_list(self) -> List[str]:
|
1089 | 1089 | def format_array(
|
1090 | 1090 | values: Any,
|
1091 | 1091 | formatter: Optional[Callable],
|
1092 |
| - float_format: Optional[float_format_type] = None, |
| 1092 | + float_format: Optional[FloatFormatType] = None, |
1093 | 1093 | na_rep: str = "NaN",
|
1094 | 1094 | digits: Optional[int] = None,
|
1095 | 1095 | space: Optional[Union[str, int]] = None,
|
@@ -1171,7 +1171,7 @@ def __init__(
|
1171 | 1171 | formatter: Optional[Callable] = None,
|
1172 | 1172 | na_rep: str = "NaN",
|
1173 | 1173 | space: Union[str, int] = 12,
|
1174 |
| - float_format: Optional[float_format_type] = None, |
| 1174 | + float_format: Optional[FloatFormatType] = None, |
1175 | 1175 | justify: str = "right",
|
1176 | 1176 | decimal: str = ".",
|
1177 | 1177 | quoting: Optional[int] = None,
|
@@ -1278,7 +1278,7 @@ def __init__(self, *args, **kwargs):
|
1278 | 1278 |
|
1279 | 1279 | def _value_formatter(
|
1280 | 1280 | self,
|
1281 |
| - float_format: Optional[float_format_type] = None, |
| 1281 | + float_format: Optional[FloatFormatType] = None, |
1282 | 1282 | threshold: Optional[Union[float, int]] = None,
|
1283 | 1283 | ) -> Callable:
|
1284 | 1284 | """Returns a function to be applied on each value to format it"""
|
@@ -1372,7 +1372,7 @@ def format_values_with(float_format):
|
1372 | 1372 |
|
1373 | 1373 | # There is a special default string when we are fixed-width
|
1374 | 1374 | # The default is otherwise to use str instead of a formatting string
|
1375 |
| - float_format: Optional[float_format_type] |
| 1375 | + float_format: Optional[FloatFormatType] |
1376 | 1376 | if self.float_format is None:
|
1377 | 1377 | if self.fixed_width:
|
1378 | 1378 | float_format = partial(
|
|
0 commit comments