From 84af226507b41472cac3fd2aed855bf376d4472e Mon Sep 17 00:00:00 2001 From: Abdulaziz Aloqeely <52792999+Aloqeely@users.noreply.github.com> Date: Mon, 13 May 2024 07:44:29 +0300 Subject: [PATCH 1/6] TST: Fix test failures for test_api_read_sql_duplicate_columns and test_multi_thread_string_io_read_csv --- pandas/tests/io/parser/test_multi_thread.py | 2 +- pandas/tests/io/test_sql.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/tests/io/parser/test_multi_thread.py b/pandas/tests/io/parser/test_multi_thread.py index 7fac67df44ca2..6f0cabddbe26b 100644 --- a/pandas/tests/io/parser/test_multi_thread.py +++ b/pandas/tests/io/parser/test_multi_thread.py @@ -24,7 +24,7 @@ ] -@xfail_pyarrow # ValueError: Found non-unique column index +@pytest.mark.filterwarnings("ignore:Passing a BlockManager:DeprecationWarning") def test_multi_thread_string_io_read_csv(all_parsers): # see gh-11786 parser = all_parsers diff --git a/pandas/tests/io/test_sql.py b/pandas/tests/io/test_sql.py index c8f921f2be0fb..cb2593d16f195 100644 --- a/pandas/tests/io/test_sql.py +++ b/pandas/tests/io/test_sql.py @@ -2302,7 +2302,7 @@ def test_api_read_sql_duplicate_columns(conn, request): if "adbc" in conn: pa = pytest.importorskip("pyarrow") if not ( - Version(pa.__version__) >= Version("16.0") and conn == "sqlite_adbc_conn" + Version(pa.__version__) >= Version("16.0") and conn in ["sqlite_adbc_conn", "postgresql_adbc_conn"] ): request.node.add_marker( pytest.mark.xfail( From 4753b2f7207879e4008bf9788cdb2b1b8e911121 Mon Sep 17 00:00:00 2001 From: Abdulaziz Aloqeely <52792999+Aloqeely@users.noreply.github.com> Date: Mon, 13 May 2024 08:44:28 +0300 Subject: [PATCH 2/6] Fix line length --- pandas/tests/io/test_sql.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandas/tests/io/test_sql.py b/pandas/tests/io/test_sql.py index cb2593d16f195..6058f34d25ad3 100644 --- a/pandas/tests/io/test_sql.py +++ b/pandas/tests/io/test_sql.py @@ -2302,7 +2302,8 @@ def test_api_read_sql_duplicate_columns(conn, request): if "adbc" in conn: pa = pytest.importorskip("pyarrow") if not ( - Version(pa.__version__) >= Version("16.0") and conn in ["sqlite_adbc_conn", "postgresql_adbc_conn"] + Version(pa.__version__) >= Version("16.0") + and conn in ["sqlite_adbc_conn", "postgresql_adbc_conn"] ): request.node.add_marker( pytest.mark.xfail( From 45a968bf65db9476228a38594f61e755e9768f95 Mon Sep 17 00:00:00 2001 From: Abdulaziz Aloqeely <52792999+Aloqeely@users.noreply.github.com> Date: Mon, 13 May 2024 09:22:50 +0300 Subject: [PATCH 3/6] xfail if pyarrow version < 16 --- pandas/tests/io/parser/test_multi_thread.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pandas/tests/io/parser/test_multi_thread.py b/pandas/tests/io/parser/test_multi_thread.py index 6f0cabddbe26b..88a86dfc4c190 100644 --- a/pandas/tests/io/parser/test_multi_thread.py +++ b/pandas/tests/io/parser/test_multi_thread.py @@ -13,6 +13,7 @@ import pandas as pd from pandas import DataFrame import pandas._testing as tm +from pandas.util.version import Version xfail_pyarrow = pytest.mark.usefixtures("pyarrow_xfail") @@ -25,9 +26,17 @@ @pytest.mark.filterwarnings("ignore:Passing a BlockManager:DeprecationWarning") -def test_multi_thread_string_io_read_csv(all_parsers): +def test_multi_thread_string_io_read_csv(all_parsers, request): # see gh-11786 parser = all_parsers + if parser == "pyarrow": + pa = pytest.importorskip("pyarrow") + if Version(pa.__version__) < Version("16.0"): + request.applymarker( + pytest.mark.xfail( + reason="# ValueError: Found non-unique column index", strict=True + ) + ) max_row_range = 100 num_files = 10 From 9c59eab188637e2cb29674d056321665c57daf25 Mon Sep 17 00:00:00 2001 From: Abdulaziz Aloqeely <52792999+Aloqeely@users.noreply.github.com> Date: Mon, 13 May 2024 09:26:49 +0300 Subject: [PATCH 4/6] check name --- pandas/tests/io/parser/test_multi_thread.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/tests/io/parser/test_multi_thread.py b/pandas/tests/io/parser/test_multi_thread.py index 88a86dfc4c190..c315822823228 100644 --- a/pandas/tests/io/parser/test_multi_thread.py +++ b/pandas/tests/io/parser/test_multi_thread.py @@ -29,7 +29,7 @@ def test_multi_thread_string_io_read_csv(all_parsers, request): # see gh-11786 parser = all_parsers - if parser == "pyarrow": + if parser.engine == "pyarrow": pa = pytest.importorskip("pyarrow") if Version(pa.__version__) < Version("16.0"): request.applymarker( From 2237793ffa105bc14817b159486015dcc0018c24 Mon Sep 17 00:00:00 2001 From: Abdulaziz Aloqeely <52792999+Aloqeely@users.noreply.github.com> Date: Mon, 13 May 2024 20:47:38 +0300 Subject: [PATCH 5/6] Remove `strict` argument Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> --- pandas/tests/io/parser/test_multi_thread.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/tests/io/parser/test_multi_thread.py b/pandas/tests/io/parser/test_multi_thread.py index c315822823228..b69d775ac0ba8 100644 --- a/pandas/tests/io/parser/test_multi_thread.py +++ b/pandas/tests/io/parser/test_multi_thread.py @@ -34,7 +34,7 @@ def test_multi_thread_string_io_read_csv(all_parsers, request): if Version(pa.__version__) < Version("16.0"): request.applymarker( pytest.mark.xfail( - reason="# ValueError: Found non-unique column index", strict=True + reason="# ValueError: Found non-unique column index" ) ) max_row_range = 100 From dce25f1d0bead0cef04088ffd76b8906e97ed2c3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 13 May 2024 17:51:24 +0000 Subject: [PATCH 6/6] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pandas/tests/io/parser/test_multi_thread.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pandas/tests/io/parser/test_multi_thread.py b/pandas/tests/io/parser/test_multi_thread.py index b69d775ac0ba8..649a1324686a7 100644 --- a/pandas/tests/io/parser/test_multi_thread.py +++ b/pandas/tests/io/parser/test_multi_thread.py @@ -33,9 +33,7 @@ def test_multi_thread_string_io_read_csv(all_parsers, request): pa = pytest.importorskip("pyarrow") if Version(pa.__version__) < Version("16.0"): request.applymarker( - pytest.mark.xfail( - reason="# ValueError: Found non-unique column index" - ) + pytest.mark.xfail(reason="# ValueError: Found non-unique column index") ) max_row_range = 100 num_files = 10