Bug#1084379: sklearn-pandas: FTBFS: NameError: name 'mapper5' is not defined

Santiago Vila sanvila at debian.org
Mon Oct 7 09:42:12 BST 2024


Package: src:sklearn-pandas
Version: 2.2.0-3
Severity: serious
Tags: ftbfs

Dear maintainer:

During a rebuild of all packages in unstable, your package failed to build:

--------------------------------------------------------------------------------
[...]
  debian/rules binary
dh binary --buildsystem=pybuild
    dh_update_autotools_config -O--buildsystem=pybuild
    dh_autoreconf -O--buildsystem=pybuild
    dh_auto_configure -O--buildsystem=pybuild
	pybuild --configure -i python{version} -p 3.12
I: pybuild base:311: python3.12 setup.py config
/<<PKGBUILDDIR>>/setup.py:5: SetuptoolsDeprecationWarning: The test command is disabled and references to it are deprecated.
!!

         ********************************************************************************
         Please remove any references to `setuptools.command.test` in all supported versions of the affected package.

         By 2024-Nov-15, you need to update your project and remove deprecated calls

[... snipped ...]

Exception raised:
     Traceback (most recent call last):
       File "/usr/lib/python3.12/doctest.py", line 1368, in __run
         exec(compile(example.source, filename, "single",
       File "<doctest README.rst[41]>", line 1, in <module>
         mapper3 = DataFrameMapper([
                   ^^^^^^^^^^^^^^^
     NameError: name 'DataFrameMapper' is not defined
Trying:
     np.round(mapper3.fit_transform(data.copy()))
Expecting:
     array([[1., 0., 0., 4.],
            [0., 1., 0., 6.],
            [0., 1., 0., 3.],
            [0., 0., 1., 3.],
            [1., 0., 0., 2.],
            [0., 1., 0., 3.],
            [1., 0., 0., 5.],
            [0., 0., 1., 4.]])
**********************************************************************
File "README.rst", line 344, in README.rst
Failed example:
     np.round(mapper3.fit_transform(data.copy()))
Exception raised:
     Traceback (most recent call last):
       File "/usr/lib/python3.12/doctest.py", line 1368, in __run
         exec(compile(example.source, filename, "single",
       File "<doctest README.rst[42]>", line 1, in <module>
         np.round(mapper3.fit_transform(data.copy()))
                  ^^^^^^^
     NameError: name 'mapper3' is not defined
Trying:
     mapper4 = DataFrameMapper([
         ('pet', sklearn.preprocessing.LabelBinarizer()),
         ('children', None)
     ], default=sklearn.preprocessing.StandardScaler())
Expecting nothing
**********************************************************************
File "README.rst", line 360, in README.rst
Failed example:
     mapper4 = DataFrameMapper([
         ('pet', sklearn.preprocessing.LabelBinarizer()),
         ('children', None)
     ], default=sklearn.preprocessing.StandardScaler())
Exception raised:
     Traceback (most recent call last):
       File "/usr/lib/python3.12/doctest.py", line 1368, in __run
         exec(compile(example.source, filename, "single",
       File "<doctest README.rst[43]>", line 1, in <module>
         mapper4 = DataFrameMapper([
                   ^^^^^^^^^^^^^^^
     NameError: name 'DataFrameMapper' is not defined
Trying:
     np.round(mapper4.fit_transform(data.copy()), 1)
Expecting:
     array([[ 1. ,  0. ,  0. ,  4. ,  2.3],
            [ 0. ,  1. ,  0. ,  6. , -0.9],
            [ 0. ,  1. ,  0. ,  3. ,  0.1],
            [ 0. ,  0. ,  1. ,  3. , -0.7],
            [ 1. ,  0. ,  0. ,  2. , -0.5],
            [ 0. ,  1. ,  0. ,  3. ,  0.8],
            [ 1. ,  0. ,  0. ,  5. , -0.3],
            [ 0. ,  0. ,  1. ,  4. , -0.7]])
**********************************************************************
File "README.rst", line 364, in README.rst
Failed example:
     np.round(mapper4.fit_transform(data.copy()), 1)
Exception raised:
     Traceback (most recent call last):
       File "/usr/lib/python3.12/doctest.py", line 1368, in __run
         exec(compile(example.source, filename, "single",
       File "<doctest README.rst[44]>", line 1, in <module>
         np.round(mapper4.fit_transform(data.copy()), 1)
                  ^^^^^^^
     NameError: name 'mapper4' is not defined
Trying:
     from sklearn_pandas import gen_features
Expecting nothing
**********************************************************************
File "README.rst", line 390, in README.rst
Failed example:
     from sklearn_pandas import gen_features
Exception raised:
     Traceback (most recent call last):
       File "/usr/lib/python3.12/doctest.py", line 1368, in __run
         exec(compile(example.source, filename, "single",
       File "<doctest README.rst[45]>", line 1, in <module>
         from sklearn_pandas import gen_features
       File "/<<PKGBUILDDIR>>/sklearn_pandas/__init__.py", line 6, in <module>
         from .dataframe_mapper import DataFrameMapper  # NOQA
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       File "/<<PKGBUILDDIR>>/sklearn_pandas/dataframe_mapper.py", line 8, in <module>
         from .pipeline import make_transformer_pipeline, _call_fit, TransformerPipeline
       File "/<<PKGBUILDDIR>>/sklearn_pandas/pipeline.py", line 1, in <module>
         import six
     ModuleNotFoundError: No module named 'six'
Trying:
     feature_def = gen_features(
         columns=['col1', 'col2', 'col3'],
         classes=[sklearn.preprocessing.LabelEncoder]
     )
Expecting nothing
**********************************************************************
File "README.rst", line 391, in README.rst
Failed example:
     feature_def = gen_features(
         columns=['col1', 'col2', 'col3'],
         classes=[sklearn.preprocessing.LabelEncoder]
     )
Exception raised:
     Traceback (most recent call last):
       File "/usr/lib/python3.12/doctest.py", line 1368, in __run
         exec(compile(example.source, filename, "single",
       File "<doctest README.rst[46]>", line 1, in <module>
         feature_def = gen_features(
                       ^^^^^^^^^^^^
     NameError: name 'gen_features' is not defined
Trying:
     feature_def
Expecting:
     [('col1', [LabelEncoder()], {}), ('col2', [LabelEncoder()], {}), ('col3', [LabelEncoder()], {})]
**********************************************************************
File "README.rst", line 395, in README.rst
Failed example:
     feature_def
Exception raised:
     Traceback (most recent call last):
       File "/usr/lib/python3.12/doctest.py", line 1368, in __run
         exec(compile(example.source, filename, "single",
       File "<doctest README.rst[47]>", line 1, in <module>
         feature_def
     NameError: name 'feature_def' is not defined
Trying:
     mapper5 = DataFrameMapper(feature_def)
Expecting nothing
**********************************************************************
File "README.rst", line 397, in README.rst
Failed example:
     mapper5 = DataFrameMapper(feature_def)
Exception raised:
     Traceback (most recent call last):
       File "/usr/lib/python3.12/doctest.py", line 1368, in __run
         exec(compile(example.source, filename, "single",
       File "<doctest README.rst[48]>", line 1, in <module>
         mapper5 = DataFrameMapper(feature_def)
                   ^^^^^^^^^^^^^^^
     NameError: name 'DataFrameMapper' is not defined
Trying:
     data5 = pd.DataFrame({
         'col1': ['yes', 'no', 'yes'],
         'col2': [True, False, False],
         'col3': ['one', 'two', 'three']
     })
Expecting nothing
ok
Trying:
     mapper5.fit_transform(data5)
Expecting:
     array([[1, 1, 0],
            [0, 0, 2],
            [1, 0, 1]])
**********************************************************************
File "README.rst", line 403, in README.rst
Failed example:
     mapper5.fit_transform(data5)
Exception raised:
     Traceback (most recent call last):
       File "/usr/lib/python3.12/doctest.py", line 1368, in __run
         exec(compile(example.source, filename, "single",
       File "<doctest README.rst[50]>", line 1, in <module>
         mapper5.fit_transform(data5)
         ^^^^^^^
     NameError: name 'mapper5' is not defined
Trying:
     from sklearn.impute import SimpleImputer
Expecting nothing
ok
Trying:
     import numpy as np
Expecting nothing
ok
Trying:
     feature_def = gen_features(
         columns=[['col1'], ['col2'], ['col3']],
         classes=[{'class': SimpleImputer, 'strategy':'most_frequent'}]
     )
Expecting nothing
**********************************************************************
File "README.rst", line 414, in README.rst
Failed example:
     feature_def = gen_features(
         columns=[['col1'], ['col2'], ['col3']],
         classes=[{'class': SimpleImputer, 'strategy':'most_frequent'}]
     )
Exception raised:
     Traceback (most recent call last):
       File "/usr/lib/python3.12/doctest.py", line 1368, in __run
         exec(compile(example.source, filename, "single",
       File "<doctest README.rst[53]>", line 1, in <module>
         feature_def = gen_features(
                       ^^^^^^^^^^^^
     NameError: name 'gen_features' is not defined
Trying:
     mapper6 = DataFrameMapper(feature_def)
Expecting nothing
**********************************************************************
File "README.rst", line 418, in README.rst
Failed example:
     mapper6 = DataFrameMapper(feature_def)
Exception raised:
     Traceback (most recent call last):
       File "/usr/lib/python3.12/doctest.py", line 1368, in __run
         exec(compile(example.source, filename, "single",
       File "<doctest README.rst[54]>", line 1, in <module>
         mapper6 = DataFrameMapper(feature_def)
                   ^^^^^^^^^^^^^^^
     NameError: name 'DataFrameMapper' is not defined
Trying:
     data6 = pd.DataFrame({
         'col1': [np.nan, 1, 1, 2, 3],
         'col2': [True, False, np.nan, np.nan, True],
         'col3': [0, 0, 0, np.nan, np.nan]
     })
Expecting nothing
ok
Trying:
     mapper6.fit_transform(data6)
Expecting:
     array([[1.0, True, 0.0],
            [1.0, False, 0.0],
            [1.0, True, 0.0],
            [2.0, True, 0.0],
            [3.0, True, 0.0]], dtype=object)
**********************************************************************
File "README.rst", line 424, in README.rst
Failed example:
     mapper6.fit_transform(data6)
Exception raised:
     Traceback (most recent call last):
       File "/usr/lib/python3.12/doctest.py", line 1368, in __run
         exec(compile(example.source, filename, "single",
       File "<doctest README.rst[56]>", line 1, in <module>
         mapper6.fit_transform(data6)
         ^^^^^^^
     NameError: name 'mapper6' is not defined
Trying:
     feature_def = gen_features(
         columns=['col1', 'col2', 'col3'],
         classes=[sklearn.preprocessing.LabelEncoder],
         prefix="lblencoder_"
     )
Expecting nothing
**********************************************************************
File "README.rst", line 434, in README.rst
Failed example:
     feature_def = gen_features(
         columns=['col1', 'col2', 'col3'],
         classes=[sklearn.preprocessing.LabelEncoder],
         prefix="lblencoder_"
     )
Exception raised:
     Traceback (most recent call last):
       File "/usr/lib/python3.12/doctest.py", line 1368, in __run
         exec(compile(example.source, filename, "single",
       File "<doctest README.rst[57]>", line 1, in <module>
         feature_def = gen_features(
                       ^^^^^^^^^^^^
     NameError: name 'gen_features' is not defined
Trying:
     mapper5 = DataFrameMapper(feature_def)
Expecting nothing
**********************************************************************
File "README.rst", line 439, in README.rst
Failed example:
     mapper5 = DataFrameMapper(feature_def)
Exception raised:
     Traceback (most recent call last):
       File "/usr/lib/python3.12/doctest.py", line 1368, in __run
         exec(compile(example.source, filename, "single",
       File "<doctest README.rst[58]>", line 1, in <module>
         mapper5 = DataFrameMapper(feature_def)
                   ^^^^^^^^^^^^^^^
     NameError: name 'DataFrameMapper' is not defined
Trying:
     data5 = pd.DataFrame({
         'col1': ['yes', 'no', 'yes'],
         'col2': [True, False, False],
         'col3': ['one', 'two', 'three']
     })
Expecting nothing
ok
Trying:
     _ = mapper5.fit_transform(data5)
Expecting nothing
**********************************************************************
File "README.rst", line 445, in README.rst
Failed example:
     _ = mapper5.fit_transform(data5)
Exception raised:
     Traceback (most recent call last):
       File "/usr/lib/python3.12/doctest.py", line 1368, in __run
         exec(compile(example.source, filename, "single",
       File "<doctest README.rst[60]>", line 1, in <module>
         _ = mapper5.fit_transform(data5)
             ^^^^^^^
     NameError: name 'mapper5' is not defined
Trying:
     mapper5.transformed_names_
Expecting:
     ['lblencoder_col1', 'lblencoder_col2', 'lblencoder_col3']
**********************************************************************
File "README.rst", line 446, in README.rst
Failed example:
     mapper5.transformed_names_
Exception raised:
     Traceback (most recent call last):
       File "/usr/lib/python3.12/doctest.py", line 1368, in __run
         exec(compile(example.source, filename, "single",
       File "<doctest README.rst[61]>", line 1, in <module>
         mapper5.transformed_names_
         ^^^^^^^
     NameError: name 'mapper5' is not defined
Trying:
     from sklearn.feature_selection import SelectKBest, chi2
Expecting nothing
ok
Trying:
     mapper_fs = DataFrameMapper([(['children','salary'], SelectKBest(chi2, k=1))])
Expecting nothing
**********************************************************************
File "README.rst", line 455, in README.rst
Failed example:
     mapper_fs = DataFrameMapper([(['children','salary'], SelectKBest(chi2, k=1))])
Exception raised:
     Traceback (most recent call last):
       File "/usr/lib/python3.12/doctest.py", line 1368, in __run
         exec(compile(example.source, filename, "single",
       File "<doctest README.rst[63]>", line 1, in <module>
         mapper_fs = DataFrameMapper([(['children','salary'], SelectKBest(chi2, k=1))])
                     ^^^^^^^^^^^^^^^
     NameError: name 'DataFrameMapper' is not defined
Trying:
     mapper_fs.fit_transform(data[['children','salary']], data['pet'])
Expecting:
     array([[90.],
            [24.],
            [44.],
            [27.],
            [32.],
            [59.],
            [36.],
            [27.]])
**********************************************************************
File "README.rst", line 456, in README.rst
Failed example:
     mapper_fs.fit_transform(data[['children','salary']], data['pet'])
Exception raised:
     Traceback (most recent call last):
       File "/usr/lib/python3.12/doctest.py", line 1368, in __run
         exec(compile(example.source, filename, "single",
       File "<doctest README.rst[64]>", line 1, in <module>
         mapper_fs.fit_transform(data[['children','salary']], data['pet'])
         ^^^^^^^^^
     NameError: name 'mapper_fs' is not defined
Trying:
     mapper5 = DataFrameMapper([
         ('pet', CountVectorizer()),
     ], sparse=True)
Expecting nothing
**********************************************************************
File "README.rst", line 472, in README.rst
Failed example:
     mapper5 = DataFrameMapper([
         ('pet', CountVectorizer()),
     ], sparse=True)
Exception raised:
     Traceback (most recent call last):
       File "/usr/lib/python3.12/doctest.py", line 1368, in __run
         exec(compile(example.source, filename, "single",
       File "<doctest README.rst[65]>", line 1, in <module>
         mapper5 = DataFrameMapper([
                   ^^^^^^^^^^^^^^^
     NameError: name 'DataFrameMapper' is not defined
Trying:
     type(mapper5.fit_transform(data))
Expecting:
     <class 'scipy.sparse._csr.csr_matrix'>
**********************************************************************
File "README.rst", line 475, in README.rst
Failed example:
     type(mapper5.fit_transform(data))
Exception raised:
     Traceback (most recent call last):
       File "/usr/lib/python3.12/doctest.py", line 1368, in __run
         exec(compile(example.source, filename, "single",
       File "<doctest README.rst[66]>", line 1, in <module>
         type(mapper5.fit_transform(data))
              ^^^^^^^
     NameError: name 'mapper5' is not defined
Trying:
     from sklearn_pandas import NumericalTransformer
Expecting nothing
**********************************************************************
File "README.rst", line 488, in README.rst
Failed example:
     from sklearn_pandas import NumericalTransformer
Exception raised:
     Traceback (most recent call last):
       File "/usr/lib/python3.12/doctest.py", line 1368, in __run
         exec(compile(example.source, filename, "single",
       File "<doctest README.rst[67]>", line 1, in <module>
         from sklearn_pandas import NumericalTransformer
       File "/<<PKGBUILDDIR>>/sklearn_pandas/__init__.py", line 6, in <module>
         from .dataframe_mapper import DataFrameMapper  # NOQA
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       File "/<<PKGBUILDDIR>>/sklearn_pandas/dataframe_mapper.py", line 8, in <module>
         from .pipeline import make_transformer_pipeline, _call_fit, TransformerPipeline
       File "/<<PKGBUILDDIR>>/sklearn_pandas/pipeline.py", line 1, in <module>
         import six
     ModuleNotFoundError: No module named 'six'
Trying:
     mapper5 = DataFrameMapper([
         ('children', NumericalTransformer('log')),
     ])
Expecting nothing
**********************************************************************
File "README.rst", line 489, in README.rst
Failed example:
     mapper5 = DataFrameMapper([
         ('children', NumericalTransformer('log')),
     ])
Exception raised:
     Traceback (most recent call last):
       File "/usr/lib/python3.12/doctest.py", line 1368, in __run
         exec(compile(example.source, filename, "single",
       File "<doctest README.rst[68]>", line 1, in <module>
         mapper5 = DataFrameMapper([
                   ^^^^^^^^^^^^^^^
     NameError: name 'DataFrameMapper' is not defined
Trying:
     mapper5.fit_transform(data)
Expecting:
     array([[1.38629436],
            [1.79175947],
            [1.09861229],
            [1.09861229],
            [0.69314718],
            [1.09861229],
            [1.60943791],
            [1.38629436]])
**********************************************************************
File "README.rst", line 492, in README.rst
Failed example:
     mapper5.fit_transform(data)
Exception raised:
     Traceback (most recent call last):
       File "/usr/lib/python3.12/doctest.py", line 1368, in __run
         exec(compile(example.source, filename, "single",
       File "<doctest README.rst[69]>", line 1, in <module>
         mapper5.fit_transform(data)
         ^^^^^^^
     NameError: name 'mapper5' is not defined
Trying:
     import logging
Expecting nothing
ok
Trying:
     logging.getLogger('sklearn_pandas').setLevel(logging.INFO)
Expecting nothing
ok
**********************************************************************
1 items had failures:
   49 of  72 in README.rst
72 tests in 1 items.
23 passed and 49 failed.
***Test Failed*** 49 failures.
E: pybuild pybuild:389: test: plugin distutils failed with: exit code=1: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_sklearn-pandas/build; python3.12 -m pytest ; cd {dir}; python{version} -m doctest -v README.rst
	rm -fr -- /tmp/dh-xdg-rundir-gmPWMRsi
dh_auto_test: error: pybuild --test --test-pytest -i python{version} -p 3.12 returned exit code 13
make: *** [debian/rules:7: binary] Error 25
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
--------------------------------------------------------------------------------

The above is just how the build ends and not necessarily the most relevant part.
If required, the full build log is available here:

https://people.debian.org/~sanvila/build-logs/202410/

About the archive rebuild: The build was made on virtual machines from AWS,
using sbuild and a reduced chroot with only build-essential packages.

If you could not reproduce the bug please contact me privately, as I
am willing to provide ssh access to a virtual machine where the bug is
fully reproducible.

If this is really a bug in one of the build-depends, please use
reassign and affects, so that this is still visible in the BTS web
page for this package.

Thanks.



More information about the debian-science-maintainers mailing list