Skip to content

Commit 0ddf563

Browse files
authored
TYP: fix mypy ignored error in pandas/io/formats/latex.py (#37738)
1 parent cf31d1b commit 0ddf563

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

pandas/io/formats/latex.py

+5-7
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

@@ -74,9 +74,7 @@ def __init__(
7474
self.multirow = multirow
7575
self.clinebuf: List[List[int]] = []
7676
self.strcols = self._get_strcols()
77-
self.strrows: List[List[str]] = list(
78-
zip(*self.strcols) # type: ignore[arg-type]
79-
)
77+
self.strrows = list(zip(*self.strcols))
8078

8179
def get_strrow(self, row_num: int) -> str:
8280
"""Get string representation of the row."""
@@ -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)