Skip to content

ARROW-10951: [Python][CI] Fix nightly pandas builds (pytest monkeypatch issue) - #8952

Closed
jorisvandenbossche wants to merge 2 commits into
apache:masterfrom
jorisvandenbossche:ARROW-10951
Closed

jorisvandenbossche wants to merge 2 commits into
apache:masterfrom
jorisvandenbossche:ARROW-10951

Conversation

@jorisvandenbossche

Copy link
Copy Markdown
Member

No description provided.

@jorisvandenbossche

Copy link
Copy Markdown
Member Author

This is rather ugly and brittle (since it relies on the exact place where this method is defined in pandas). But I also can't directly think of a better way to keep the original intent of the test.

@jorisvandenbossche

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit test-conda-python-3.7-pandas-master test-conda-python-3.8-pandas-nightly

@github-actions

Copy link
Copy Markdown

Revision: fc5b3a0

Submitted crossbow builds: ursa-labs/crossbow @ actions-811

Task Status
test-conda-python-3.7-pandas-master Github Actions
test-conda-python-3.8-pandas-nightly Github Actions

@github-actions

Copy link
Copy Markdown

@jorisvandenbossche

Copy link
Copy Markdown
Member Author

There is still a failure, but a different one now:

_________________ TestConvertMetadata.test_mixed_column_names __________________

self = <pyarrow.tests.test_pandas.TestConvertMetadata object at 0x7f8ee85413c0>

    def test_mixed_column_names(self):
        # mixed type column names are not reconstructed exactly
        df = pd.DataFrame({'a': [1, 2], 'b': [3, 4]})
    
        for cols in [['あ', b'a'], [1, '2'], [1, 1.5]]:
            df.columns = pd.Index(cols, dtype=object)
    
            # assert that the from_pandas raises the warning
            with pytest.warns(UserWarning):
                pa.Table.from_pandas(df)
    
            expected = df.copy()
            expected.columns = df.columns.astype(str)
            with pytest.warns(UserWarning):
                _check_pandas_roundtrip(df, expected=expected,
>                                       preserve_index=True)

opt/conda/envs/arrow/lib/python3.7/site-packages/pyarrow/tests/test_pandas.py:422: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
opt/conda/envs/arrow/lib/python3.7/site-packages/pyarrow/tests/test_pandas.py:102: in _check_pandas_roundtrip
    else False))
pandas/_libs/testing.pyx:46: in pandas._libs.testing.assert_almost_equal
    ???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   AssertionError: DataFrame.columns are different
E   
E   DataFrame.columns values are different (50.0 %)
E   [left]:  Index(['あ', 'a'], dtype='object')
E   [right]: Index(['あ', 'b'a''], dtype='object')

pandas/_libs/testing.pyx:161: AssertionError

@jorisvandenbossche

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit test-conda-python-3.7-pandas-master test-conda-python-3.8-pandas-nightly

@github-actions

Copy link
Copy Markdown

Revision: b0dd4db

Submitted crossbow builds: ursa-labs/crossbow @ actions-819

Task Status
test-conda-python-3.7-pandas-master Github Actions
test-conda-python-3.8-pandas-nightly Github Actions

@jorisvandenbossche

Copy link
Copy Markdown
Member Author

OK, all green, so merging this to get the nightly builds passing.

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.

1 participant