Source: glueviz
Version: 1.24.1+dfsg-3
Control: block 1141694 by -1
glueviz fails autopkgtests with pandas 3.0 (in experimental):
https://ci.debian.net/packages/g/glueviz/unstable/amd64/73190613/
It looks like it's explicitly checking dtypes, and not expecting the
newly-default string dtype.
Upstream release notes: https://pandas.pydata.org/docs/whatsnew/v3.0.0.html
454s =================================== FAILURES
===================================
454s ___________________________ test_csv_pandas_factory
____________________________
454s
454s def test_csv_pandas_factory():
454s data = b"""a,b,c,d
454s 1,2.1,some,True
454s 2,2.4,categorical,False
454s 3,1.4,data,True
454s 4,4.0,here,True
454s 5,6.3,,False
454s 6,8.7,,False
454s 8,9.2,,True"""
454s
454s with make_file(data, '.csv') as fname:
454s d = df.load_data(fname, factory=df.pandas_read_table)
454s assert d['a'].dtype == np.int64
454s assert d['b'].dtype == float
454s > assert d['c'].dtype.kind == 'U'
454s E AssertionError: assert 'O' == 'U'
454s E
454s E - U
454s E + O
454s
454s
/usr/lib/python3/dist-packages/glue/core/data_factories/tests/test_data_factories.py:110:
AssertionError
454s ______________________________ test_excel_single
_______________________________
454s
454s @requires_openpyxl
454s def test_excel_single():
454s
454s from ..excel import panda_read_excel
454s
454s d = panda_read_excel(os.path.join(DATA,
'simple_data.xlsx'), sheet='Data2')[0]
454s
454s assert_array_equal(d['1'], [2, 3, 4, 5])
454s assert d['1'].dtype.kind == 'i'
454s assert_array_equal(d['a'], ['b', 'c', 'd', 'e'])
454s > assert d['a'].dtype.kind == 'U'
454s E AssertionError: assert 'O' == 'U'
454s E
454s E - U
454s E + O
454s
454s
/usr/lib/python3/dist-packages/glue/core/data_factories/tests/test_excel.py:54:
AssertionError
454s ________________________ test_translator_data_roundtrip
________________________
454s
454s def test_translator_data_roundtrip():
454s
454s # Case where we start from a Dataframe, convert to a glue
data object,
454s # and convert back to a DataFrame.
454s
454s df = DataFrame()
454s df['a'] = [3, 5, 6, 7]
454s df['b'] = [1.5, 2.2, 1.3, 3.3]
454s df['c'] = ['r', 'd', 'w', 'q']
454s
454s dc = DataCollection()
454s dc['dataframe'] = df
454s
454s data = dc['dataframe']
454s assert isinstance(data, Data)
454s assert data.main_components == ['a', 'b', 'c']
454s assert_equal(data['a'], [3, 5, 6, 7])
454s assert_equal(data['b'], [1.5, 2.2, 1.3, 3.3])
454s assert_equal(data['c'], ['r', 'd', 'w', 'q'])
454s
454s df2 = data.get_object()
454s assert_equal(list(df2.columns), ['a', 'b', 'c'])
454s assert_equal(df2['a'].values, [3, 5, 6, 7])
454s assert_equal(df2['b'].values, [1.5, 2.2, 1.3, 3.3])
454s > assert_equal(df2['c'].values, ['r', 'd', 'w', 'q'])
454s E ValueError: The truth value of an array with more than one
element is ambiguous. Use a.any() or a.all()
454s
454s
/usr/lib/python3/dist-packages/glue/core/data_factories/tests/test_pandas.py:33:
ValueError
454s __________________________ test_translator_from_data
___________________________
454s
454s def test_translator_from_data():
454s
454s # Case where the initial data object wasn't originally
created from a
454s # DataFrame.
454s
454s data = Data()
454s data['a'] = [3, 5, 6, 7]
454s data['b'] = [1.5, 2.2, 1.3, 3.3]
454s data['c'] = ['r', 'd', 'w', 'q']
454s
454s with pytest.raises(ValueError) as exc:
454s df = data.get_object()
454s # Do not specify full error message in case plugins add
new translations
454s assert 'Specify the object class to use with cls' in
exc.value.args[0]
454s
454s df = data.get_object(cls=DataFrame)
454s assert_equal(list(df.columns), ['a', 'b', 'c'])
454s assert_equal(df['a'].values, [3, 5, 6, 7])
454s assert_equal(df['b'].values, [1.5, 2.2, 1.3, 3.3])
454s > assert_equal(df['c'].values, ['r', 'd', 'w', 'q'])
454s E ValueError: The truth value of an array with more than one
element is ambiguous. Use a.any() or a.all()
454s
454s
/usr/lib/python3/dist-packages/glue/core/data_factories/tests/test_pandas.py:55:
ValueError
454s _________________________ test_translator_from_subset
__________________________
454s
454s def test_translator_from_subset():
454s
454s # Case where we convert a subset to a DataFrame
454s
454s data = Data()
454s data['a'] = [3, 5, 6, 7]
454s data['b'] = [1.5, 2.2, 1.3, 3.3]
454s data['c'] = ['r', 'd', 'w', 'q']
454s
454s dc = DataCollection([data])
454s dc.new_subset_group(label='test subset',
subset_state=data.id['b'] > 2)
454s
454s df = data.get_subset_object(cls=DataFrame)
454s assert_equal(list(df.columns), ['a', 'b', 'c'])
454s assert_equal(df['a'].values, [5, 7])
454s assert_equal(df['b'].values, [2.2, 3.3])
454s > assert_equal(df['c'].values, ['d', 'q'])
454s E ValueError: The truth value of an array with more than one
element is ambiguous. Use a.any() or a.all()
454s
454s
/usr/lib/python3/dist-packages/glue/core/data_factories/tests/test_pandas.py:74:
ValueError
454s __________
TestPandasConversion.test_CategoricalComponent_conversion ___________
454s
454s self = <glue.core.tests.test_pandas.TestPandasConversion object at
0x7f368fcb7ce0>
454s
454s def test_CategoricalComponent_conversion(self):
454s
454s comp = CategoricalComponent(np.array(['a', 'b', 'c', 'd']))
454s series = pd.Series(['a', 'b', 'c', 'd'])
454s
454s > assert_series_equal(series, comp.to_series())
454s E AssertionError: Attributes of Series are different
454s E
454s E Attribute "dtype" are different
454s E [left]: <StringDtype(storage='python', na_value=nan)>
454s E [right]: object
454s
454s /usr/lib/python3/dist-packages/glue/core/tests/test_pandas.py:35:
AssertionError
454s __________________ TestPandasConversion.test_Data_conversion
___________________
454s
454s self = <glue.core.tests.test_pandas.TestPandasConversion object at
0x7f368fbe9010>
454s
454s def test_Data_conversion(self):
454s
454s d = Data(n=np.array([4, 5, 6, 7]))
454s cat_comp = CategoricalComponent(np.array(['a', 'b', 'c', 'd']))
454s d.add_component(cat_comp, 'c')
454s link = MagicMock()
454s link.compute.return_value = np.arange(4)
454s deriv_comp = DerivedComponent(d, link)
454s d.add_component(deriv_comp, 'd')
454s order = [comp.label for comp in d.components]
454s
454s frame = pd.DataFrame()
454s frame['Pixel Axis 0 [x]'] = np.ogrid[0:4]
454s frame['n'] = np.array([4, 5, 6, 7])
454s frame['c'] = ['a', 'b', 'c', 'd']
454s frame['d'] = np.arange(4)
454s out_frame = d.to_dataframe()
454s
454s > assert_frame_equal(out_frame, frame)
454s E AssertionError: Attributes of DataFrame.iloc[:, 2] (column
name="c") are different
454s E
454s E Attribute "dtype" are different
454s E [left]: object
454s E [right]: <StringDtype(storage='python', na_value=nan)>
454s
454s /usr/lib/python3/dist-packages/glue/core/tests/test_pandas.py:62:
AssertionError