From 3eed8976c8bbae2950153900724b6a8c085c95c4 Mon Sep 17 00:00:00 2001 From: Will Ayd Date: Fri, 10 Nov 2023 08:02:12 -0500 Subject: [PATCH] Bumped ADBC min to 0.8.0 --- ci/deps/actions-310.yaml | 4 +- ci/deps/actions-311-downstream_compat.yaml | 4 +- ci/deps/actions-311.yaml | 4 +- ci/deps/actions-39-minimum_versions.yaml | 4 +- ci/deps/actions-39.yaml | 4 +- ci/deps/circle-310-arm64.yaml | 4 +- doc/source/getting_started/install.rst | 4 +- environment.yml | 4 +- pandas/compat/_optional.py | 4 +- pandas/tests/io/test_sql.py | 48 ++-------------------- pyproject.toml | 4 +- requirements-dev.txt | 4 +- 12 files changed, 26 insertions(+), 66 deletions(-) diff --git a/ci/deps/actions-310.yaml b/ci/deps/actions-310.yaml index e769c973b147f..f73e05b13cdcd 100644 --- a/ci/deps/actions-310.yaml +++ b/ci/deps/actions-310.yaml @@ -59,7 +59,7 @@ dependencies: - zstandard>=0.19.0 - pip: - - adbc-driver-postgresql>=0.7.0 - - adbc-driver-sqlite>=0.7.0 + - adbc-driver-postgresql>=0.8.0 + - adbc-driver-sqlite>=0.8.0 - pyqt5>=5.15.8 - tzdata>=2022.7 diff --git a/ci/deps/actions-311-downstream_compat.yaml b/ci/deps/actions-311-downstream_compat.yaml index 35ebf73a372d7..59df5d72bd078 100644 --- a/ci/deps/actions-311-downstream_compat.yaml +++ b/ci/deps/actions-311-downstream_compat.yaml @@ -73,8 +73,8 @@ dependencies: - pyyaml - py - pip: - - adbc-driver-postgresql>=0.7.0 - - adbc-driver-sqlite>=0.7.0 + - adbc-driver-postgresql>=0.8.0 + - adbc-driver-sqlite>=0.8.0 - dataframe-api-compat>=0.1.7 - pyqt5>=5.15.8 - tzdata>=2022.7 diff --git a/ci/deps/actions-311.yaml b/ci/deps/actions-311.yaml index eb9894d5a5279..365f27ae27f17 100644 --- a/ci/deps/actions-311.yaml +++ b/ci/deps/actions-311.yaml @@ -59,7 +59,7 @@ dependencies: - zstandard>=0.19.0 - pip: - - adbc-driver-postgresql>=0.7.0 - - adbc-driver-sqlite>=0.7.0 + - adbc-driver-postgresql>=0.8.0 + - adbc-driver-sqlite>=0.8.0 - pyqt5>=5.15.8 - tzdata>=2022.7 diff --git a/ci/deps/actions-39-minimum_versions.yaml b/ci/deps/actions-39-minimum_versions.yaml index 43bd7072fd938..3f20f8a03a5c3 100644 --- a/ci/deps/actions-39-minimum_versions.yaml +++ b/ci/deps/actions-39-minimum_versions.yaml @@ -59,8 +59,8 @@ dependencies: - zstandard=0.19.0 - pip: - - adbc-driver-postgresql==0.7.0 - - adbc-driver-sqlite==0.7.0 + - adbc-driver-postgresql==0.8.0 + - adbc-driver-sqlite==0.8.0 - dataframe-api-compat==0.1.7 - pyqt5==5.15.8 - tzdata==2022.7 diff --git a/ci/deps/actions-39.yaml b/ci/deps/actions-39.yaml index 0e0bb892caccf..a65c4cf294cc7 100644 --- a/ci/deps/actions-39.yaml +++ b/ci/deps/actions-39.yaml @@ -59,7 +59,7 @@ dependencies: - zstandard>=0.19.0 - pip: - - adbc-driver-postgresql>=0.7.0 - - adbc-driver-sqlite>=0.7.0 + - adbc-driver-postgresql>=0.8.0 + - adbc-driver-sqlite>=0.8.0 - pyqt5>=5.15.8 - tzdata>=2022.7 diff --git a/ci/deps/circle-310-arm64.yaml b/ci/deps/circle-310-arm64.yaml index c8a1c11288594..da918f6f46862 100644 --- a/ci/deps/circle-310-arm64.yaml +++ b/ci/deps/circle-310-arm64.yaml @@ -58,5 +58,5 @@ dependencies: - xlsxwriter>=3.0.5 - zstandard>=0.19.0 - pip: - - adbc-driver-postgresql>=0.7.0 - - adbc-driver-sqlite>=0.7.0 + - adbc-driver-postgresql>=0.8.0 + - adbc-driver-sqlite>=0.8.0 diff --git a/doc/source/getting_started/install.rst b/doc/source/getting_started/install.rst index 31f8222ae6c32..5f8ccabea530a 100644 --- a/doc/source/getting_started/install.rst +++ b/doc/source/getting_started/install.rst @@ -346,8 +346,8 @@ SQLAlchemy 2.0.0 postgresql, SQL support for dat sql-other psycopg2 2.9.6 postgresql PostgreSQL engine for sqlalchemy pymysql 1.0.2 mysql MySQL engine for sqlalchemy -adbc-driver-postgresql 0.7.0 ADBC Driver for PostgreSQL -adbc-driver-sqlite 0.7.0 ADBC Driver for SQLite +adbc-driver-postgresql 0.8.0 ADBC Driver for PostgreSQL +adbc-driver-sqlite 0.8.0 ADBC Driver for SQLite ========================= ================== =============== ============================================================= Other data sources diff --git a/environment.yml b/environment.yml index e2a03317148a6..5fa65532bdf00 100644 --- a/environment.yml +++ b/environment.yml @@ -113,8 +113,8 @@ dependencies: - pygments # Code highlighting - pip: - - adbc-driver-postgresql>=0.7.0 - - adbc-driver-sqlite>=0.7.0 + - adbc-driver-postgresql>=0.8.0 + - adbc-driver-sqlite>=0.8.0 - dataframe-api-compat>=0.1.7 - sphinx-toggleprompt # conda-forge version has stricter pins on jinja2 - typing_extensions; python_version<"3.11" diff --git a/pandas/compat/_optional.py b/pandas/compat/_optional.py index 817979f0cba01..84cf7af0fe7a6 100644 --- a/pandas/compat/_optional.py +++ b/pandas/compat/_optional.py @@ -15,8 +15,8 @@ # Update install.rst & setup.cfg when updating versions! VERSIONS = { - "adbc-driver-postgresql": "0.7.0", - "adbc-driver-sqlite": "0.7.0", + "adbc-driver-postgresql": "0.8.0", + "adbc-driver-sqlite": "0.8.0", "bs4": "4.11.2", "blosc": "1.21.3", "bottleneck": "1.3.6", diff --git a/pandas/tests/io/test_sql.py b/pandas/tests/io/test_sql.py index d168c40b5db85..b758d37dad7b8 100644 --- a/pandas/tests/io/test_sql.py +++ b/pandas/tests/io/test_sql.py @@ -274,25 +274,17 @@ def create_and_load_types_sqlite3(conn, types_data: list[dict]): def create_and_load_types_postgresql(conn, types_data: list[dict]): - # Boolean support not added until 0.8.0 - adbc = import_optional_dependency("adbc_driver_manager", errors="ignore") - - if adbc and Version(adbc.__version__) < Version("0.8.0"): - bool_type = "INTEGER" - else: - bool_type = "BOOLEAN" - with conn.cursor() as cur: - stmt = f"""CREATE TABLE types ( + stmt = """CREATE TABLE types ( "TextCol" TEXT, "DateCol" TIMESTAMP, "IntDateCol" INTEGER, "IntDateOnlyCol" INTEGER, "FloatCol" DOUBLE PRECISION, "IntCol" INTEGER, - "BoolCol" {bool_type}, + "BoolCol" BOOLEAN, "IntColWithNull" INTEGER, - "BoolColWithNull" {bool_type} + "BoolColWithNull" BOOLEAN )""" cur.execute(stmt) @@ -724,17 +716,7 @@ def postgresql_adbc_types(postgresql_adbc_conn, types_data): conn.adbc_get_table_schema("types") except mgr.ProgrammingError: conn.rollback() - # Boolean support not added until 0.8.0 - adbc = import_optional_dependency("adbc_driver_manager") - if Version(adbc.__version__) < Version("0.8.0"): - new_data = [] - for entry in types_data: - entry["BoolCol"] = int(entry["BoolCol"]) - if entry["BoolColWithNull"] is not None: - entry["BoolColWithNull"] = int(entry["BoolColWithNull"]) - new_data.append(tuple(entry.values())) - else: - new_data = [tuple(entry.values()) for entry in types_data] + new_data = [tuple(entry.values()) for entry in types_data] create_and_load_types_postgresql(conn, new_data) @@ -3539,11 +3521,6 @@ def test_read_sql_dtype_backend( conn = request.getfixturevalue(conn) table = "test" df = dtype_backend_data - if "adbc" in conn_name: - # Boolean support not added until 0.8.0 - adbc = import_optional_dependency("adbc_driver_manager") - if Version(adbc.__version__) < Version("0.8.0"): - df = df.drop(columns=["e", "f"]) df.to_sql(name=table, con=conn, index=False, if_exists="replace") with pd.option_context("mode.string_storage", string_storage): @@ -3551,10 +3528,6 @@ def test_read_sql_dtype_backend( f"Select * from {table}", conn, dtype_backend=dtype_backend ) expected = dtype_backend_expected(string_storage, dtype_backend, conn_name) - if "adbc" in conn_name: - adbc = import_optional_dependency("adbc_driver_manager") - if Version(adbc.__version__) < Version("0.8.0"): - expected = expected.drop(columns=["e", "f"]) tm.assert_frame_equal(result, expected) if "adbc" in conn_name: @@ -3598,19 +3571,11 @@ def test_read_sql_dtype_backend_table( conn = request.getfixturevalue(conn) table = "test" df = dtype_backend_data - if "adbc" in conn_name: - adbc = import_optional_dependency("adbc_driver_manager") - if Version(adbc.__version__) < Version("0.8.0"): - df = df.drop(columns=["e", "f"]) df.to_sql(name=table, con=conn, index=False, if_exists="replace") with pd.option_context("mode.string_storage", string_storage): result = getattr(pd, func)(table, conn, dtype_backend=dtype_backend) expected = dtype_backend_expected(string_storage, dtype_backend, conn_name) - if "adbc" in conn_name: - adbc = import_optional_dependency("adbc_driver_manager") - if Version(adbc.__version__) < Version("0.8.0"): - expected = expected.drop(columns=["e", "f"]) tm.assert_frame_equal(result, expected) if "adbc" in conn_name: @@ -3632,14 +3597,9 @@ def test_read_sql_dtype_backend_table( @pytest.mark.parametrize("conn", all_connectable) @pytest.mark.parametrize("func", ["read_sql", "read_sql_table", "read_sql_query"]) def test_read_sql_invalid_dtype_backend_table(conn, request, func, dtype_backend_data): - conn_name = conn conn = request.getfixturevalue(conn) table = "test" df = dtype_backend_data - if "adbc" in conn_name: - adbc = import_optional_dependency("adbc_driver_manager") - if Version(adbc.__version__) < Version("0.8.0"): - df = df.drop(columns=["e", "f"]) df.to_sql(name=table, con=conn, index=False, if_exists="replace") msg = ( diff --git a/pyproject.toml b/pyproject.toml index a0058bf26ea22..fa746a471a5cb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -86,8 +86,8 @@ output-formatting = ['jinja2>=3.1.2', 'tabulate>=0.9.0'] clipboard = ['PyQt5>=5.15.8', 'qtpy>=2.3.0'] compression = ['zstandard>=0.19.0'] consortium-standard = ['dataframe-api-compat>=0.1.7'] -all = ['adbc-driver-postgresql>=0.7.0', - 'adbc-driver-sqlite>=0.7.0', +all = ['adbc-driver-postgresql>=0.8.0', + 'adbc-driver-sqlite>=0.8.0', 'beautifulsoup4>=4.11.2', # blosc only available on conda (https://github.com/Blosc/python-blosc/issues/297) #'blosc>=1.21.3', diff --git a/requirements-dev.txt b/requirements-dev.txt index a799e8b00ae64..3a68da45bc4dc 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -81,8 +81,8 @@ feedparser pyyaml requests pygments -adbc-driver-postgresql>=0.7.0 -adbc-driver-sqlite>=0.7.0 +adbc-driver-postgresql>=0.8.0 +adbc-driver-sqlite>=0.8.0 dataframe-api-compat>=0.1.7 sphinx-toggleprompt typing_extensions; python_version<"3.11"