[MNT] migrate scaling module to narwhals - #979
Open
ojassharma7 wants to merge 4 commits into
Open
Conversation
* update dataframe checks * update dataframe checks take 2 * update dataframe checks take 3 * update docstrings * refactor dataframe checks * fix mypy error * add missing type hints * add missing matching error syntax * finalise tests for df checks'
Use narwhals for MeanNormalisationScaler fit/transform/inverse_transform math so the scaler can work with any dataframe backend narwhals supports. Pandas unit tests continue to pass; polars auto variable-selection still depends on upcoming variable_handling updates. Co-authored-by: Cursor <cursoragent@cursor.com>
solegalli
force-pushed
the
narwhals-migration
branch
3 times, most recently
from
July 31, 2026 12:30
8fe8359 to
ea95750
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrates
feature_engine/scaling(MeanNormalisationScaler) sofit/transform/inverse_transformuse narwhals for the mean / range / scaling math, returning a native dataframe of the same type as the input.Context
Part of #965. @solegalli suggested
scalingas a good first module. Variable selection (find_numerical_variables/ friends) is still pandas-backed on this branch — as noted, pandas tests should pass; full polars support waits on the variable-handling work Sole is doing.Test plan
pytest tests/test_scaling/(pandas) — 8 passed locallynarwhals-migration