REF: Consolidate validation of dictionary argument in agg/transform by rhshadrach · Pull Request #40004 · pandas-dev/pandas (original) (raw)
- Ensure all linting tests pass, see here for how to run them
Currently there are no tests for dict-like argument with agg when a DataFrame is missing a column (edit: in the apply tests, there are tests in groupby, resample, and window). This PR changes the error slightly from
f"Column '{k}' does not exist!"
to
f"Column(s) {cols} do not exist"
in order to make it consistent (and I think more helpful, in the case of multiple columns) with the error message from transform.