Skip to content

[BUG] make_column_transformer fails on a two-dimensional Python list input #8502

Description

@apiqwe

Describe the bug

cuml.compose.make_column_transformer fails when fit_transform() receives a regular two-dimensional Python list.

During remainder validation, cuML accesses X.shape[1] without first converting or validating the array-like input. A Python list has no .shape attribute, so the call raises:

AttributeError: 'list' object has no attribute 'shape'

The equivalent sklearn.compose.make_column_transformer call accepts the same list input and returns the expected standardized column.

Steps/Code to reproduce bug

cuML reproducer:

from cuml.compose import make_column_transformer
from cuml.preprocessing import StandardScaler

a = [[1, 2],[3, 4],[5, 6],]

print(make_column_transformer((StandardScaler(), [0])).fit_transform(a))

Output:

Traceback (most recent call last):
  File "/workspace/apibughub/cuml/make_column_transformer/error_bug1/error_bug_cuml.py", line 6, in <module>
    print(make_column_transformer((StandardScaler(), [0])).fit_transform(a))
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
  File "/opt/conda/envs/rapids-26.08/lib/python3.14/site-packages/cuml/internals/outputs.py", line 874, in inner
    res = func(*args, **kwargs)
  File "/opt/conda/envs/rapids-26.08/lib/python3.14/site-packages/cuml/_thirdparty/sklearn/preprocessing/_column_transformer.py", line 901, in fit_transform
    self._validate_remainder(X)
    ~~~~~~~~~~~~~~~~~~~~~~~~^^^
  File "/opt/conda/envs/rapids-26.08/lib/python3.14/site-packages/cuml/_thirdparty/sklearn/preprocessing/_column_transformer.py", line 729, in _validate_remainder
    self._n_features = X.shape[1]
                       ^^^^^^^
AttributeError: 'list' object has no attribute 'shape'

For comparison, the equivalent scikit-learn code:

from sklearn.compose import make_column_transformer
from sklearn.preprocessing import StandardScaler

a = [[1, 2],[3, 4],[5, 6],]

print(make_column_transformer((StandardScaler(), [0])).fit_transform(a))

Output:

[[-1.22474487]
 [ 0.        ]
 [ 1.22474487]]

Expected behavior

make_column_transformer(...).fit_transform() should accept a rectangular two-dimensional Python list as array-like input, convert or validate it appropriately, and apply StandardScaler to the selected column.

For this input, the transformed output should be equivalent to:

[[-1.22474487]
 [ 0.        ]
 [ 1.22474487]]

If Python lists are intentionally unsupported, the API should raise a clear input-validation error describing the supported input types rather than leaking an internal AttributeError.

Environment details (please complete the following information):

  • Environment location: Docker
  • Linux Distro/Architecture: Ubuntu 24.04 / x86_64
  • GPU Model/Driver: NVIDIA GeForce RTX 4090 / 595.71.05
  • CUDA: 13.2
  • Method of cuDF & cuML install: conda

conda list:

# Name              Version       Build                                      Channel
python              3.14.6        h242f9ac_102_cp314                         conda-forge
numpy               2.4.6         py314h2b28147_0                            conda-forge
scipy               1.16.3        py314hf07bd8e_2                            conda-forge
scikit-learn        1.9.0         np2py314hf09ca88_0                         conda-forge
rapids              26.08.00      cuda13_260806_c2656556                     rapidsai
cuml                26.08.00      cuda13_cp311_abi3_260805_265b9da6          rapidsai
libcuml             26.08.00      cuda13_260805_265b9da6                     rapidsai
cudf                26.08.00      cuda13_cp311_abi3_260805_ff5b362d          rapidsai
libraft             26.08.00      cuda13_260805_ebf92684                     rapidsai
libraft-headers     26.08.00      cuda13_260805_ebf92684                     rapidsai
pylibraft           26.08.00      cuda13_cp311_abi3_260805_ebf92684          rapidsai
cuvs                26.08.01      cuda13_cp311_abi3_260806_25b1be43          rapidsai
libcuvs             26.08.01      cuda13_260806_25b1be43                     rapidsai
cupy                14.1.1        py314hdea9c46_0                            conda-forge
cupy-core           14.1.1        py314hcd3b49b_0                            conda-forge
numba               0.64.0        py314h8169c2f_0                            conda-forge
numba-cuda          0.30.4        py314h42812f9_0                            conda-forge
rmm                 26.08.00      cuda13_cp311_abi3_260805_42d059f1          rapidsai
librmm              26.08.00      cuda13_260805_42d059f1                     rapidsai
cuda-version        13.3           hcbadf70_3                                 conda-forge
cuda-bindings       13.3.1        py314h42812f9_1                            conda-forge
cuda-cudart         13.3.29       hecca717_0                                 conda-forge
cuda-nvrtc          13.3.33       hecca717_0                                 conda-forge
libcublas           13.6.0.2      h676940d_0                                 conda-forge
libcusolver         12.2.6.9      h676940d_0                                 conda-forge
libcusparse         12.8.2.51     hecca717_0                                 conda-forge
libcurand           10.4.3.29     h676940d_0                                 conda-forge

Metadata

Metadata

Assignees

No one assigned

    Labels

    ? - Needs TriageNeed team to review and classifybugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions