Skip to content

Commit 50aab0d

Browse files
committed
Fix still incorrect typing
1 parent b33dc9e commit 50aab0d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pandas/io/html.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ def _expand_colspan_rowspan(self, rows, header=False):
489489
"""
490490
all_texts = [] # list of rows, each a list of str
491491
remainder: list[
492-
tuple[int, str | tuple, int]
492+
tuple[int, str | tuple[str] | tuple[str, str], int]
493493
] = [] # list of (index, text, nrows)
494494

495495
for tr in rows:
@@ -509,12 +509,14 @@ def _expand_colspan_rowspan(self, rows, header=False):
509509
index += 1
510510

511511
# Append the text from this <td>, colspan times
512-
text = _remove_whitespace(self._text_getter(td))
512+
td_text = _remove_whitespace(self._text_getter(td))
513513
if not header and self.extract_hrefs:
514514
# All cells will be tuples except for the headers for
515515
# consistency in selection (e.g. using .str indexing)
516516
href = self._href_getter(td)
517-
text = (text, href) if href else (text,)
517+
text = (td_text, href) if href else (td_text,)
518+
else:
519+
text = td_text
518520
rowspan = int(self._attr_getter(td, "rowspan") or 1)
519521
colspan = int(self._attr_getter(td, "colspan") or 1)
520522

0 commit comments

Comments
 (0)