Skip to content

Commit 0db44b8

Browse files
committed
mypy fix
1 parent ed7c1f6 commit 0db44b8

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

pandas/io/formats/style.py

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
Sequence,
2020
Tuple,
2121
Union,
22+
cast,
2223
)
2324
from uuid import uuid4
2425

@@ -1904,25 +1905,14 @@ def _pseudo_css(self, uuid: str, name: str, row: int, col: int, text: str):
19041905
-------
19051906
pseudo_css : List
19061907
"""
1908+
selector_id = "#T_" + uuid + "row" + str(row) + "_col" + str(col)
19071909
return [
19081910
{
1909-
"selector": "#T_"
1910-
+ uuid
1911-
+ "row"
1912-
+ str(row)
1913-
+ "_col"
1914-
+ str(col)
1915-
+ f":hover .{name}",
1911+
"selector": selector_id + f":hover .{name}",
19161912
"props": [("visibility", "visible")],
19171913
},
19181914
{
1919-
"selector": "#T_"
1920-
+ uuid
1921-
+ "row"
1922-
+ str(row)
1923-
+ "_col"
1924-
+ str(col)
1925-
+ f" .{name}::after",
1915+
"selector": selector_id + f" .{name}::after",
19261916
"props": [("content", f'"{text}"')],
19271917
},
19281918
]
@@ -2089,7 +2079,7 @@ def _format_table_styles(styles: CSSStyles) -> CSSStyles:
20892079
for sublist in [
20902080
[
20912081
{"selector": x, "props": style["props"]}
2092-
for x in style["selector"].split(",")
2082+
for x in cast(str, style["selector"]).split(",")
20932083
]
20942084
for style in styles
20952085
]

0 commit comments

Comments
 (0)