great-tables
great-tables copied to clipboard
Double check implementation of pattern= argument
The pattern= argument in format methods (e.g. .fmt_number()) substitutes in the formatted value in a template. The template expects {x} as the placeholder. It looks like the substitution is done sometimes using the .replace() method.
Let's look at the implementations of pattern to see whether it might benefit from using .format(x=...). It could be that .replace() was used because .format() errors for unused template variables. E.g.
# errors
s = "{x} {y}".format(x = 1)
So it could be .replace() is totally fine!