Skip to content

Commit 82cda0d

Browse files
authored
cln: redundant function (#39632)
Co-authored-by: JHM Darbyshire (iMac) <[email protected]>
1 parent 8d48776 commit 82cda0d

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

pandas/io/formats/style.py

+2-9
Original file line numberDiff line numberDiff line change
@@ -391,9 +391,6 @@ def _translate(self):
391391
BLANK_CLASS = "blank"
392392
BLANK_VALUE = ""
393393

394-
def format_attr(pair):
395-
return f"{pair['key']}={pair['value']}"
396-
397394
# for sparsifying a MultiIndex
398395
idx_lengths = _get_level_lengths(self.index)
399396
col_lengths = _get_level_lengths(self.columns, hidden_columns)
@@ -462,9 +459,7 @@ def format_attr(pair):
462459
}
463460
colspan = col_lengths.get((r, c), 0)
464461
if colspan > 1:
465-
es["attributes"] = [
466-
format_attr({"key": "colspan", "value": f'"{colspan}"'})
467-
]
462+
es["attributes"] = [f'colspan="{colspan}"']
468463
row_es.append(es)
469464
head.append(row_es)
470465

@@ -508,9 +503,7 @@ def format_attr(pair):
508503
}
509504
rowspan = idx_lengths.get((c, r), 0)
510505
if rowspan > 1:
511-
es["attributes"] = [
512-
format_attr({"key": "rowspan", "value": f'"{rowspan}"'})
513-
]
506+
es["attributes"] = [f'rowspan="{rowspan}"']
514507
row_es.append(es)
515508

516509
for c, col in enumerate(self.data.columns):

0 commit comments

Comments
 (0)