1818import numpy as np
1919import pytest
2020
21- from pandas ._config import using_string_dtype
22-
2321from pandas ._libs import lib
2422from pandas .compat import pa_version_under14p1
2523from pandas .compat ._optional import import_optional_dependency
6058 pytest .mark .filterwarnings (
6159 "ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
6260 ),
63- pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" , strict = False ),
6461]
6562
6663
@@ -682,6 +679,7 @@ def postgresql_psycopg2_conn(postgresql_psycopg2_engine):
682679
683680@pytest .fixture
684681def postgresql_adbc_conn ():
682+ pytest .importorskip ("pyarrow" )
685683 pytest .importorskip ("adbc_driver_postgresql" )
686684 from adbc_driver_postgresql import dbapi
687685
@@ -814,6 +812,7 @@ def sqlite_conn_types(sqlite_engine_types):
814812
815813@pytest .fixture
816814def sqlite_adbc_conn ():
815+ pytest .importorskip ("pyarrow" )
817816 pytest .importorskip ("adbc_driver_sqlite" )
818817 from adbc_driver_sqlite import dbapi
819818
@@ -986,8 +985,7 @@ def test_dataframe_to_sql_empty(conn, test_frame1, request):
986985 if conn == "postgresql_adbc_conn" :
987986 request .node .add_marker (
988987 pytest .mark .xfail (
989- reason = "postgres ADBC driver cannot insert index with null type" ,
990- strict = True ,
988+ reason = "postgres ADBC driver < 1.2 cannot insert index with null type" ,
991989 )
992990 )
993991 # GH 51086 if conn is sqlite_engine
@@ -3554,7 +3552,8 @@ def test_read_sql_dtype_backend(
35543552 result = getattr (pd , func )(
35553553 f"Select * from { table } " , conn , dtype_backend = dtype_backend
35563554 )
3557- expected = dtype_backend_expected (string_storage , dtype_backend , conn_name )
3555+ expected = dtype_backend_expected (string_storage , dtype_backend , conn_name )
3556+
35583557 tm .assert_frame_equal (result , expected )
35593558
35603559 if "adbc" in conn_name :
@@ -3604,7 +3603,7 @@ def test_read_sql_dtype_backend_table(
36043603
36053604 with pd .option_context ("mode.string_storage" , string_storage ):
36063605 result = getattr (pd , func )(table , conn , dtype_backend = dtype_backend )
3607- expected = dtype_backend_expected (string_storage , dtype_backend , conn_name )
3606+ expected = dtype_backend_expected (string_storage , dtype_backend , conn_name )
36083607 tm .assert_frame_equal (result , expected )
36093608
36103609 if "adbc" in conn_name :
@@ -4120,7 +4119,7 @@ def tquery(query, con=None):
41204119def test_xsqlite_basic (sqlite_buildin ):
41214120 frame = DataFrame (
41224121 np .random .default_rng (2 ).standard_normal ((10 , 4 )),
4123- columns = Index (list ("ABCD" ), dtype = object ),
4122+ columns = Index (list ("ABCD" )),
41244123 index = date_range ("2000-01-01" , periods = 10 , freq = "B" ),
41254124 )
41264125 assert sql .to_sql (frame , name = "test_table" , con = sqlite_buildin , index = False ) == 10
@@ -4147,7 +4146,7 @@ def test_xsqlite_basic(sqlite_buildin):
41474146def test_xsqlite_write_row_by_row (sqlite_buildin ):
41484147 frame = DataFrame (
41494148 np .random .default_rng (2 ).standard_normal ((10 , 4 )),
4150- columns = Index (list ("ABCD" ), dtype = object ),
4149+ columns = Index (list ("ABCD" )),
41514150 index = date_range ("2000-01-01" , periods = 10 , freq = "B" ),
41524151 )
41534152 frame .iloc [0 , 0 ] = np .nan
@@ -4170,7 +4169,7 @@ def test_xsqlite_write_row_by_row(sqlite_buildin):
41704169def test_xsqlite_execute (sqlite_buildin ):
41714170 frame = DataFrame (
41724171 np .random .default_rng (2 ).standard_normal ((10 , 4 )),
4173- columns = Index (list ("ABCD" ), dtype = object ),
4172+ columns = Index (list ("ABCD" )),
41744173 index = date_range ("2000-01-01" , periods = 10 , freq = "B" ),
41754174 )
41764175 create_sql = sql .get_schema (frame , "test" )
@@ -4191,7 +4190,7 @@ def test_xsqlite_execute(sqlite_buildin):
41914190def test_xsqlite_schema (sqlite_buildin ):
41924191 frame = DataFrame (
41934192 np .random .default_rng (2 ).standard_normal ((10 , 4 )),
4194- columns = Index (list ("ABCD" ), dtype = object ),
4193+ columns = Index (list ("ABCD" )),
41954194 index = date_range ("2000-01-01" , periods = 10 , freq = "B" ),
41964195 )
41974196 create_sql = sql .get_schema (frame , "test" )
0 commit comments