Skip to content

Commit 82db42f

Browse files
committed
ENH: black fix
1 parent 0e34c24 commit 82db42f

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

pandas/io/formats/style.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -966,12 +966,12 @@ def set_table_styles(self, table_styles, axis=0, overwrite=True) -> "Styler":
966966
... }, axis=1, overwrite=False)
967967
"""
968968
if isinstance(table_styles, dict):
969-
if axis == 0 or axis == 'index':
969+
if axis == 0 or axis == "index":
970970
obj = self.data.columns
971-
idf = '.col'
971+
idf = ".col"
972972
else:
973973
obj = self.data.index
974-
idf = '.row'
974+
idf = ".row"
975975

976976
_styles = []
977977
for key, styles in table_styles.items():

pandas/tests/io/formats/test_style.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -1688,20 +1688,17 @@ def test_chaining_table_styles(self):
16881688
[{"selector": "", "props": [("background-color", "yellow")]}]
16891689
).set_table_styles(
16901690
[{"selector": ".col0", "props": [("background-color", "blue")]}],
1691-
overwrite=False
1691+
overwrite=False,
16921692
)
16931693
assert len(styler.table_styles) == 2
16941694

16951695
def test_column_and_row_styling(self):
16961696
df = pd.DataFrame(data=[[0, 1], [1, 2]], columns=["A", "B"])
16971697
s = Styler(df, uuid="_")
1698-
s = s.set_table_styles(
1699-
{"A": [{"selector": "", "props": [("color", "blue")]}]}
1700-
)
1698+
s = s.set_table_styles({"A": [{"selector": "", "props": [("color", "blue")]}]})
17011699
assert "#T__ .col0 {\n color: blue;\n }" in s.render()
17021700
s = s.set_table_styles(
1703-
{0: [{"selector": "", "props": [("color", "blue")]}]},
1704-
axis=1
1701+
{0: [{"selector": "", "props": [("color", "blue")]}]}, axis=1
17051702
)
17061703
assert "#T__ .row0 {\n color: blue;\n }" in s.render()
17071704

0 commit comments

Comments
 (0)