-
Notifications
You must be signed in to change notification settings - Fork 118
Open
Description
The cols_*() methods raise if a single column name is passed that is not in the data. However, they do not raise if that missing name is in a list.
Here's a reprex
# %%
import pandas as pd
import great_tables as gt
df = pd.DataFrame({"A": [1], "B": [2]})
t = gt.GT(df)
# String input → raises error
# t.cols_align(columns="NOPE") # AssertionError
# t.cols_label_with(columns="NOPE", fn=str.lower) # AssertionError
# List input → silently ignores "NOPE"
t.cols_align(columns=["A", "NOPE"]) # no error, only A aligned
t.cols_label_with(columns=["A", "NOPE"], fn=str.lower) # no error, only A relabeled
t.cols_hide(columns=["A", "NOPE"]) # no error, only A hidden
t.cols_move(columns=["A", "NOPE"], after="A") # no error, only A moved
t.cols_move_to_start(columns=["A", "NOPE"]) # no error
t.cols_move_to_end(columns=["A", "NOPE"]) # no errorReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels