Skip to content

Commit 4dfd2e2

Browse files
rendneryehoshuadimarsky
authored andcommitted
BUG 44011 - use dict as input for "set_table_styles" (pandas-dev#45733)
1 parent a17e0c5 commit 4dfd2e2

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

pandas/tests/io/formats/style/test_style.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -839,12 +839,16 @@ def test_table_styles_multiple(self):
839839
def test_table_styles_dict_multiple_selectors(self):
840840
# GH 44011
841841
result = self.df.style.set_table_styles(
842-
[{"selector": "th,td", "props": [("border-left", "2px solid black")]}]
842+
{
843+
"B": [
844+
{"selector": "th,td", "props": [("border-left", "2px solid black")]}
845+
]
846+
}
843847
)._translate(True, True)["table_styles"]
844848

845849
expected = [
846-
{"selector": "th", "props": [("border-left", "2px solid black")]},
847-
{"selector": "td", "props": [("border-left", "2px solid black")]},
850+
{"selector": "th.col1", "props": [("border-left", "2px solid black")]},
851+
{"selector": "td.col1", "props": [("border-left", "2px solid black")]},
848852
]
849853

850854
assert result == expected

0 commit comments

Comments
 (0)