From 80935846ffbb5cf2f0393526ba42d759c81254ec Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Tue, 25 Aug 2020 17:08:14 -0500 Subject: [PATCH 1/5] CI: docker 32-bit linux build #32709 --- azure-pipelines.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 113ad3e338952..84803b9fe813e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -26,3 +26,28 @@ jobs: parameters: name: Windows vmImage: vs2017-win2016 + +- job: py37_32bit + pool: + vmImage: ubuntu-18.04 + + steps: + - script: | + docker pull quay.io/pypa/manylinux2014_i686 + docker run -v $(pwd):/pandas quay.io/pypa/manylinux2010_i686 \ + /bin/bash -xc "cd pandas && \ + /opt/python/cp37-cp37m/bin/python -m venv ~/virtualenvs/pandas-dev && \ + . ~/virtualenvs/pandas-dev/bin/activate && \ + python -m pip install --no-deps -U pip wheel setuptools && \ + pip install cython numpy python-dateutil pytz pytest pytest-xdist hypothesis pytest-azurepipelines && \ + python setup.py build_ext -q -i -j2 && \ + python -m pip install --no-build-isolation -e . && \ + pytest -m 'not slow and not network and not clipboard' pandas --junitxml=test-data.xml" + displayName: 'Run 32-bit manylinux2014 Docker Build / Tests' + + - task: PublishTestResults@2 + condition: succeededOrFailed() + inputs: + testResultsFiles: '**/test-*.xml' + failTaskOnFailedTests: true + testRunTitle: 'Publish test results for Python 3.7-32 bit full Linux' From 996eab09e2bd6954c85ff9a49480930349f0b0a2 Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Thu, 27 Aug 2020 11:15:23 -0500 Subject: [PATCH 2/5] fix manylinux version typo --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 84803b9fe813e..b1091ea7f60e4 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -34,7 +34,7 @@ jobs: steps: - script: | docker pull quay.io/pypa/manylinux2014_i686 - docker run -v $(pwd):/pandas quay.io/pypa/manylinux2010_i686 \ + docker run -v $(pwd):/pandas quay.io/pypa/manylinux2014_i686 \ /bin/bash -xc "cd pandas && \ /opt/python/cp37-cp37m/bin/python -m venv ~/virtualenvs/pandas-dev && \ . ~/virtualenvs/pandas-dev/bin/activate && \ From 7a1c7f26b65162c6175e0e127e1f90091f66979c Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Sun, 25 Oct 2020 16:32:29 -0500 Subject: [PATCH 3/5] TST/CI: fix 32bit dtype tests #36579, #32709 --- pandas/tests/arrays/floating/test_function.py | 11 +++++++++-- pandas/tests/base/test_misc.py | 7 +++++-- pandas/tests/groupby/test_groupby.py | 4 ++-- pandas/tests/io/parser/test_c_parser_only.py | 6 +++++- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/pandas/tests/arrays/floating/test_function.py b/pandas/tests/arrays/floating/test_function.py index 2767d93741d4c..f426141096db2 100644 --- a/pandas/tests/arrays/floating/test_function.py +++ b/pandas/tests/arrays/floating/test_function.py @@ -1,6 +1,8 @@ import numpy as np import pytest +from pandas.compat import IS64 + import pandas as pd import pandas._testing as tm @@ -82,10 +84,15 @@ def test_ufunc_reduce_raises(values): ], ) def test_stat_method(pandasmethname, kwargs): - s = pd.Series(data=[0.1, 0.2, 0.3, 0.4, 0.5, 0.6, np.nan, np.nan], dtype="Float64") + s = pd.Series( + data=[0.1, 0.2, 0.3, 0.4, 0.5, 0.6, np.nan, np.nan], + dtype="Float64" if IS64 else "Float32", + ) pandasmeth = getattr(s, pandasmethname) result = pandasmeth(**kwargs) - s2 = pd.Series(data=[0.1, 0.2, 0.3, 0.4, 0.5, 0.6], dtype="float64") + s2 = pd.Series( + data=[0.1, 0.2, 0.3, 0.4, 0.5, 0.6], dtype="float64" if IS64 else "float32" + ) pandasmeth = getattr(s2, pandasmethname) expected = pandasmeth(**kwargs) assert expected == result diff --git a/pandas/tests/base/test_misc.py b/pandas/tests/base/test_misc.py index f7952c81cfd61..6a9d58021a4d9 100644 --- a/pandas/tests/base/test_misc.py +++ b/pandas/tests/base/test_misc.py @@ -3,7 +3,7 @@ import numpy as np import pytest -from pandas.compat import PYPY +from pandas.compat import IS64, PYPY from pandas.core.dtypes.common import ( is_categorical_dtype, @@ -128,7 +128,10 @@ def test_memory_usage(index_or_series_obj): ) if len(obj) == 0: - expected = 0 if isinstance(obj, Index) else 80 + if isinstance(obj, Index): + expected = 0 + else: + expected = 80 if IS64 else 48 assert res_deep == res == expected elif is_object or is_categorical: # only deep will pick them up diff --git a/pandas/tests/groupby/test_groupby.py b/pandas/tests/groupby/test_groupby.py index 2e51fca71e139..b57fa2540add9 100644 --- a/pandas/tests/groupby/test_groupby.py +++ b/pandas/tests/groupby/test_groupby.py @@ -1268,8 +1268,8 @@ def test_groupby_nat_exclude(): assert grouped.ngroups == 2 expected = { - Timestamp("2013-01-01 00:00:00"): np.array([1, 7], dtype=np.int64), - Timestamp("2013-02-01 00:00:00"): np.array([3, 5], dtype=np.int64), + Timestamp("2013-01-01 00:00:00"): np.array([1, 7], dtype=np.intp), + Timestamp("2013-02-01 00:00:00"): np.array([3, 5], dtype=np.intp), } for k in grouped.indices: diff --git a/pandas/tests/io/parser/test_c_parser_only.py b/pandas/tests/io/parser/test_c_parser_only.py index ae63b6af3a8b6..eee111dd4579c 100644 --- a/pandas/tests/io/parser/test_c_parser_only.py +++ b/pandas/tests/io/parser/test_c_parser_only.py @@ -13,6 +13,7 @@ import numpy as np import pytest +from pandas.compat import IS64 from pandas.errors import ParserError import pandas.util._test_decorators as td @@ -717,7 +718,10 @@ def test_float_precision_options(c_parser_only): df3 = parser.read_csv(StringIO(s), float_precision="legacy") - assert not df.iloc[0, 0] == df3.iloc[0, 0] + if IS64: + assert not df.iloc[0, 0] == df3.iloc[0, 0] + else: + assert df.iloc[0, 0] == df3.iloc[0, 0] msg = "Unrecognized float_precision option: junk" From ff1c510436c703d2eb53efbc46b6799bbc1b4dcb Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Sun, 25 Oct 2020 18:19:59 -0500 Subject: [PATCH 4/5] TST/CI: xfail 32-bit tests #36579, #32709 --- pandas/tests/arrays/floating/test_function.py | 10 +++------- pandas/tests/io/formats/test_info.py | 3 ++- pandas/tests/reshape/test_pivot.py | 3 +++ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pandas/tests/arrays/floating/test_function.py b/pandas/tests/arrays/floating/test_function.py index f426141096db2..168149c3011b2 100644 --- a/pandas/tests/arrays/floating/test_function.py +++ b/pandas/tests/arrays/floating/test_function.py @@ -73,6 +73,7 @@ def test_ufunc_reduce_raises(values): np.add.reduce(a) +@pytest.mark.xfail(not IS64, reason="GH 36579: fail on 32-bit system") @pytest.mark.parametrize( "pandasmethname, kwargs", [ @@ -84,15 +85,10 @@ def test_ufunc_reduce_raises(values): ], ) def test_stat_method(pandasmethname, kwargs): - s = pd.Series( - data=[0.1, 0.2, 0.3, 0.4, 0.5, 0.6, np.nan, np.nan], - dtype="Float64" if IS64 else "Float32", - ) + s = pd.Series(data=[0.1, 0.2, 0.3, 0.4, 0.5, 0.6, np.nan, np.nan], dtype="Float64") pandasmeth = getattr(s, pandasmethname) result = pandasmeth(**kwargs) - s2 = pd.Series( - data=[0.1, 0.2, 0.3, 0.4, 0.5, 0.6], dtype="float64" if IS64 else "float32" - ) + s2 = pd.Series(data=[0.1, 0.2, 0.3, 0.4, 0.5, 0.6], dtype="float64") pandasmeth = getattr(s2, pandasmethname) expected = pandasmeth(**kwargs) assert expected == result diff --git a/pandas/tests/io/formats/test_info.py b/pandas/tests/io/formats/test_info.py index 418d05a6b8752..8c2155aec7248 100644 --- a/pandas/tests/io/formats/test_info.py +++ b/pandas/tests/io/formats/test_info.py @@ -7,7 +7,7 @@ import numpy as np import pytest -from pandas.compat import PYPY +from pandas.compat import IS64, PYPY from pandas import ( CategoricalIndex, @@ -475,6 +475,7 @@ def test_info_categorical(): df.info(buf=buf) +@pytest.mark.xfail(not IS64, reason="GH 36579: fail on 32-bit system") def test_info_int_columns(): # GH#37245 df = DataFrame({1: [1, 2], 2: [2, 3]}, index=["A", "B"]) diff --git a/pandas/tests/reshape/test_pivot.py b/pandas/tests/reshape/test_pivot.py index 92128def4540a..642e6a691463e 100644 --- a/pandas/tests/reshape/test_pivot.py +++ b/pandas/tests/reshape/test_pivot.py @@ -4,6 +4,8 @@ import numpy as np import pytest +from pandas.compat import IS64 + import pandas as pd from pandas import ( Categorical, @@ -2104,6 +2106,7 @@ def test_pivot_duplicates(self): with pytest.raises(ValueError, match="duplicate entries"): data.pivot("a", "b", "c") + @pytest.mark.xfail(not IS64, reason="GH 36579: fail on 32-bit system") def test_pivot_empty(self): df = DataFrame(columns=["a", "b", "c"]) result = df.pivot("a", "b", "c") From bfd7088a6a68e5925173fad339d3b6be9a36f81a Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Sun, 25 Oct 2020 18:55:33 -0500 Subject: [PATCH 5/5] CI: skip test #36579, #32709 --- pandas/tests/arrays/floating/test_function.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/tests/arrays/floating/test_function.py b/pandas/tests/arrays/floating/test_function.py index 168149c3011b2..baf60a363ad29 100644 --- a/pandas/tests/arrays/floating/test_function.py +++ b/pandas/tests/arrays/floating/test_function.py @@ -73,7 +73,7 @@ def test_ufunc_reduce_raises(values): np.add.reduce(a) -@pytest.mark.xfail(not IS64, reason="GH 36579: fail on 32-bit system") +@pytest.mark.skipif(not IS64, reason="GH 36579: fail on 32-bit system") @pytest.mark.parametrize( "pandasmethname, kwargs", [