Skip to content

Commit f233a2e

Browse files
committed
TYP: fix mypy ignored error
1 parent cf31d1b commit f233a2e

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

pandas/io/formats/latex.py

+7-9
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Module for formatting output data in Latex.
33
"""
44
from abc import ABC, abstractmethod
5-
from typing import Iterator, List, Optional, Tuple, Type, Union
5+
from typing import Iterator, List, Optional, Sequence, Tuple, Type, Union
66

77
import numpy as np
88

@@ -73,10 +73,8 @@ def __init__(
7373
self.multicolumn_format = multicolumn_format
7474
self.multirow = multirow
7575
self.clinebuf: List[List[int]] = []
76-
self.strcols = self._get_strcols()
77-
self.strrows: List[List[str]] = list(
78-
zip(*self.strcols) # type: ignore[arg-type]
79-
)
76+
self.strcols: Sequence[Sequence[str]] = self._get_strcols()
77+
self.strrows: Sequence[Sequence[str]] = list(zip(*self.strcols))
8078

8179
def get_strrow(self, row_num: int) -> str:
8280
"""Get string representation of the row."""
@@ -131,7 +129,7 @@ def header_levels(self) -> int:
131129
nlevels += 1
132130
return nlevels
133131

134-
def _get_strcols(self) -> List[List[str]]:
132+
def _get_strcols(self) -> Sequence[Sequence[str]]:
135133
"""String representation of the columns."""
136134
if self.fmt.frame.empty:
137135
strcols = [[self._empty_info_line]]
@@ -179,7 +177,7 @@ def _empty_info_line(self):
179177
f"Index: {self.frame.index}"
180178
)
181179

182-
def _preprocess_row(self, row: List[str]) -> List[str]:
180+
def _preprocess_row(self, row: Sequence[str]) -> List[str]:
183181
"""Preprocess elements of the row."""
184182
if self.fmt.escape:
185183
crow = _escape_symbols(row)
@@ -781,7 +779,7 @@ def _get_index_format(self) -> str:
781779
return "l" * self.frame.index.nlevels if self.fmt.index else ""
782780

783781

784-
def _escape_symbols(row: List[str]) -> List[str]:
782+
def _escape_symbols(row: Sequence[str]) -> List[str]:
785783
"""Carry out string replacements for special symbols.
786784
787785
Parameters
@@ -813,7 +811,7 @@ def _escape_symbols(row: List[str]) -> List[str]:
813811
]
814812

815813

816-
def _convert_to_bold(crow: List[str], ilevels: int) -> List[str]:
814+
def _convert_to_bold(crow: Sequence[str], ilevels: int) -> List[str]:
817815
"""Convert elements in ``crow`` to bold."""
818816
return [
819817
f"\\textbf{{{x}}}" if j < ilevels and x.strip() not in ["", "{}"] else x

0 commit comments

Comments
 (0)