6060 pytest .mark .filterwarnings (
6161 "ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
6262 ),
63- pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" , strict = False ),
6463]
6564
6665
@@ -685,6 +684,7 @@ def postgresql_psycopg2_conn(postgresql_psycopg2_engine):
685684
686685@pytest .fixture
687686def postgresql_adbc_conn ():
687+ pytest .importorskip ("pyarrow" )
688688 pytest .importorskip ("adbc_driver_postgresql" )
689689 from adbc_driver_postgresql import dbapi
690690
@@ -817,6 +817,7 @@ def sqlite_conn_types(sqlite_engine_types):
817817
818818@pytest .fixture
819819def sqlite_adbc_conn ():
820+ pytest .importorskip ("pyarrow" )
820821 pytest .importorskip ("adbc_driver_sqlite" )
821822 from adbc_driver_sqlite import dbapi
822823
@@ -986,13 +987,13 @@ def test_dataframe_to_sql(conn, test_frame1, request):
986987
987988@pytest .mark .parametrize ("conn" , all_connectable )
988989def test_dataframe_to_sql_empty (conn , test_frame1 , request ):
989- if conn == "postgresql_adbc_conn" :
990+ if conn == "postgresql_adbc_conn" and not using_string_dtype () :
990991 request .node .add_marker (
991992 pytest .mark .xfail (
992- reason = "postgres ADBC driver cannot insert index with null type" ,
993- strict = True ,
993+ reason = "postgres ADBC driver < 1.2 cannot insert index with null type" ,
994994 )
995995 )
996+
996997 # GH 51086 if conn is sqlite_engine
997998 conn = request .getfixturevalue (conn )
998999 empty_df = test_frame1 .iloc [:0 ]
@@ -3557,7 +3558,8 @@ def test_read_sql_dtype_backend(
35573558 result = getattr (pd , func )(
35583559 f"Select * from { table } " , conn , dtype_backend = dtype_backend
35593560 )
3560- expected = dtype_backend_expected (string_storage , dtype_backend , conn_name )
3561+ expected = dtype_backend_expected (string_storage , dtype_backend , conn_name )
3562+
35613563 tm .assert_frame_equal (result , expected )
35623564
35633565 if "adbc" in conn_name :
@@ -3607,7 +3609,7 @@ def test_read_sql_dtype_backend_table(
36073609
36083610 with pd .option_context ("mode.string_storage" , string_storage ):
36093611 result = getattr (pd , func )(table , conn , dtype_backend = dtype_backend )
3610- expected = dtype_backend_expected (string_storage , dtype_backend , conn_name )
3612+ expected = dtype_backend_expected (string_storage , dtype_backend , conn_name )
36113613 tm .assert_frame_equal (result , expected )
36123614
36133615 if "adbc" in conn_name :
@@ -4123,7 +4125,7 @@ def tquery(query, con=None):
41234125def test_xsqlite_basic (sqlite_buildin ):
41244126 frame = DataFrame (
41254127 np .random .default_rng (2 ).standard_normal ((10 , 4 )),
4126- columns = Index (list ("ABCD" ), dtype = object ),
4128+ columns = Index (list ("ABCD" )),
41274129 index = date_range ("2000-01-01" , periods = 10 , freq = "B" ),
41284130 )
41294131 assert sql .to_sql (frame , name = "test_table" , con = sqlite_buildin , index = False ) == 10
@@ -4150,7 +4152,7 @@ def test_xsqlite_basic(sqlite_buildin):
41504152def test_xsqlite_write_row_by_row (sqlite_buildin ):
41514153 frame = DataFrame (
41524154 np .random .default_rng (2 ).standard_normal ((10 , 4 )),
4153- columns = Index (list ("ABCD" ), dtype = object ),
4155+ columns = Index (list ("ABCD" )),
41544156 index = date_range ("2000-01-01" , periods = 10 , freq = "B" ),
41554157 )
41564158 frame .iloc [0 , 0 ] = np .nan
@@ -4173,7 +4175,7 @@ def test_xsqlite_write_row_by_row(sqlite_buildin):
41734175def test_xsqlite_execute (sqlite_buildin ):
41744176 frame = DataFrame (
41754177 np .random .default_rng (2 ).standard_normal ((10 , 4 )),
4176- columns = Index (list ("ABCD" ), dtype = object ),
4178+ columns = Index (list ("ABCD" )),
41774179 index = date_range ("2000-01-01" , periods = 10 , freq = "B" ),
41784180 )
41794181 create_sql = sql .get_schema (frame , "test" )
@@ -4194,7 +4196,7 @@ def test_xsqlite_execute(sqlite_buildin):
41944196def test_xsqlite_schema (sqlite_buildin ):
41954197 frame = DataFrame (
41964198 np .random .default_rng (2 ).standard_normal ((10 , 4 )),
4197- columns = Index (list ("ABCD" ), dtype = object ),
4199+ columns = Index (list ("ABCD" )),
41984200 index = date_range ("2000-01-01" , periods = 10 , freq = "B" ),
41994201 )
42004202 create_sql = sql .get_schema (frame , "test" )
0 commit comments