Skip to content

Commit 50ea551

Browse files
committed
Handle FormatFns and callable fns in fmt
1 parent a21fbd8 commit 50ea551

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

great_tables/_formats.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,12 @@ def fmt(
143143

144144
# If a single function is supplied to `fns` then
145145
# repackage that into a list as the `default` function
146-
if not isinstance(fns, Callable):
147-
raise TypeError("Input to fns= should be a callable.")
148-
elif isinstance(fns, FormatFns):
146+
if isinstance(fns, FormatFns):
149147
pass
148+
elif isinstance(fns, Callable):
149+
fns = FormatFns(default=fns)
150150
else:
151-
fns: FormatFns = FormatFns(default=fns)
151+
raise TypeError("Input to fns= should be a callable.")
152152

153153
row_res = resolve_rows_i(self, rows)
154154
row_pos = [name_pos[1] for name_pos in row_res]

0 commit comments

Comments
 (0)