Skip to content

🔒 🤖 CI Update lock files for main CI build(s) 🔒 🤖 #29166

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

scikit-learn-bot
Copy link
Contributor

Update lock files.

Note

If the CI tasks fail, create a new branch based on this PR and add the required fixes to that branch.

@scikit-learn-bot scikit-learn-bot force-pushed the auto-update-lock-files-main branch from 28853e8 to c2727ea Compare June 3, 2024 05:07
Copy link

github-actions bot commented Jun 3, 2024

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: 3b49d2b. Link to the linter CI: here

@scikit-learn-bot scikit-learn-bot force-pushed the auto-update-lock-files-main branch from c2727ea to ce5cfb5 Compare June 5, 2024 00:05
@lesteve
Copy link
Member

lesteve commented Jun 5, 2024

Looks like a polars update 0.20.29 -> 0.20.31 broke something cc @MarcoGorelli in case you have any insights?

_______________ test_column_transformer_column_renaming[polars] ________________
[gw0] linux -- Python 3.11.9 /usr/share/miniconda/envs/testvenv/bin/python

dataframe_lib = 'polars'
        lib = pytest.importorskip(dataframe_lib)
    
        df = lib.DataFrame({"x1": [1, 2, 3], "x2": [10, 20, 30], "x3": [100, 200, 300]})
    
        transformer = ColumnTransformer(
            transformers=[
                ("A", "passthrough", ["x1", "x2", "x3"]),
                ("B", FunctionTransformer(), ["x1", "x2"]),
                ("C", StandardScaler(), ["x1", "x3"]),
                # special case of empty transformer
                ("D", FunctionTransformer(lambda x: x[[]]), ["x1", "x2", "x3"]),
            ],
            verbose_feature_names_out=True,
        ).set_output(transform=dataframe_lib)
        df_trans = transformer.fit_transform(df)
>       assert list(df_trans.columns) == [
            "A__x1",
            "A__x2",
            "A__x3",
            "B__x1",
            "B__x2",
            "C__x1",
            "C__x3",
        ]
E       AssertionError

dataframe_lib = 'polars'
df         = shape: (3, 3)
┌─────┬─────┬─────┐
│ x1  ┆ x2  ┆ x3  │
│ --- ┆ --- ┆ --- │
│ i64 ┆ i64 ┆ i64 │
╞═════╪═════╪═════╡
│ 1   ┆ 10  ┆ 100 │
│ 2   ┆ 20  ┆ 200 │
│ 3   ┆ 30  ┆ 300 │
└─────┴─────┴─────┘
df_trans   = shape: (3, 10)
┌───────┬───────┬───────┬───────┬───┬───────────┬───────┬───────┬───────┐
│ A__x1 ┆ A__x2 ┆ A__x3 ┆ B__...    ┆ … ┆ 1.224745  ┆ null  ┆ null  ┆ null  │
└───────┴───────┴───────┴───────┴───┴───────────┴───────┴───────┴───────┘
lib        = <module 'polars' from '/usr/share/miniconda/envs/testvenv/lib/python3.11/site-packages/polars/__init__.py'>
transformer = ColumnTransformer(transformers=[('A', 'passthrough', ['x1', 'x2', 'x3']),
                                ('B', Functi...ansformer_column_renaming.<locals>.<lambda> at 0x7fb9a0e672e0>),
                                 ['x1', 'x2', 'x3'])])

../1/s/sklearn/compose/tests/test_column_transformer.py:2530: AssertionError

@MarcoGorelli
Copy link
Contributor

MarcoGorelli commented Jun 5, 2024

Hey

Looks like it's due to this change: pola-rs/polars#16520

0.20.30:

In [2]: df = pl.DataFrame({'a': [1,2,3], 'b': [4,5,6], 'group': ['a', 'a', 'b']})

In [3]: df[[]]
Out[3]:
shape: (0, 0)
┌┐
╞╡
└┘

0.20.31:

In [17]: df = pl.DataFrame({'a': [1,2,3], 'b': [4,5,6], 'group': ['a', 'a', 'b']})

In [18]: df[[]]
Out[18]:
shape: (0, 3)
┌─────┬─────┬───────┐
│ abgroup │
│ ---------   │
│ i64i64str   │
╞═════╪═════╪═══════╡
└─────┴─────┴───────┘

@scikit-learn-bot scikit-learn-bot force-pushed the auto-update-lock-files-main branch from ce5cfb5 to 3b49d2b Compare June 6, 2024 00:19
@glemaitre
Copy link
Member

I'll have a look at the regression and propose a fix.

/take

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants