Repository navigation
FIX get_feature_names_out drops reference columns when drop_original=… - #1120
RugvedBane wants to merge 1 commit into
Conversation
|
Hi @solegalli, please take a look at this PR when you get a chance. Thanks! |
|
Hi @RugvedBane, thanks for the PR and for the clear write-up, and apologies for the delayed response. The fix is in the right place: Target the Simplify the mixin change.
Tests. On the migration branch every test in these files runs on both pandas and polars through the Thanks again! |
0d347a1 to
f9b4e65
Compare
|
Hi @solegalli, thanks for the review. I rebased onto narwhals-migration, reverted the mixin change, moved the fix into per transformer overrides of _add_new_feature_names, and extended the existing tests as suggested (including a polars set_output test) |
Fixes #1103
When drop_original=True, transform() drops both variables and reference
columns, but get_feature_names_out() only dropped variables.
Fix: DatetimeSubtraction and RelativeFeatures now override
_add_new_feature_names to drop the same columns as their transform().
The shared mixin is unchanged.
Tests: added a reference-not-in-variables case to the existing
test_get_feature_names_out in both files (pandas and polars via make_df),
plus set_output tests for pandas and polars.