Open Noghpu opened 1 month ago
In version 0.5.2 using polars expressions as the rows argument of fmt_* methods seems to work fine. However, Pylance reports an argument type error because the typing is int | list[int] | None.
rows
fmt_*
int | list[int] | None
import polars as pl import polars.selectors as cs from great_tables import GT from IPython.display import display df = pl.DataFrame( dict( rowname=["weight", "age"], personA=[75, 60], personB=[50, 20], ) ) gt = GT(df, rowname_col="rowname").fmt_integer( columns=cs.starts_with("person"), rows=pl.col("rowname") == "weight", # TypeError pattern="{x} kg", ) display(gt)
Output as expected:
In version 0.5.2 using polars expressions as the
rows
argument offmt_*
methods seems to work fine. However, Pylance reports an argument type error because the typing isint | list[int] | None
.Output as expected: