60
60
pytest .mark .filterwarnings (
61
61
"ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
62
62
),
63
- pytest .mark .xfail ( using_string_dtype (), reason = "TODO(infer_string)" , strict = False ) ,
63
+ pytest .mark .single_cpu ,
64
64
]
65
65
66
66
@@ -685,6 +685,7 @@ def postgresql_psycopg2_conn(postgresql_psycopg2_engine):
685
685
686
686
@pytest .fixture
687
687
def postgresql_adbc_conn ():
688
+ pytest .importorskip ("pyarrow" )
688
689
pytest .importorskip ("adbc_driver_postgresql" )
689
690
from adbc_driver_postgresql import dbapi
690
691
@@ -817,6 +818,7 @@ def sqlite_conn_types(sqlite_engine_types):
817
818
818
819
@pytest .fixture
819
820
def sqlite_adbc_conn ():
821
+ pytest .importorskip ("pyarrow" )
820
822
pytest .importorskip ("adbc_driver_sqlite" )
821
823
from adbc_driver_sqlite import dbapi
822
824
@@ -986,13 +988,13 @@ def test_dataframe_to_sql(conn, test_frame1, request):
986
988
987
989
@pytest .mark .parametrize ("conn" , all_connectable )
988
990
def test_dataframe_to_sql_empty (conn , test_frame1 , request ):
989
- if conn == "postgresql_adbc_conn" :
991
+ if conn == "postgresql_adbc_conn" and not using_string_dtype () :
990
992
request .node .add_marker (
991
993
pytest .mark .xfail (
992
- reason = "postgres ADBC driver cannot insert index with null type" ,
993
- strict = True ,
994
+ reason = "postgres ADBC driver < 1.2 cannot insert index with null type" ,
994
995
)
995
996
)
997
+
996
998
# GH 51086 if conn is sqlite_engine
997
999
conn = request .getfixturevalue (conn )
998
1000
empty_df = test_frame1 .iloc [:0 ]
@@ -3557,7 +3559,8 @@ def test_read_sql_dtype_backend(
3557
3559
result = getattr (pd , func )(
3558
3560
f"Select * from { table } " , conn , dtype_backend = dtype_backend
3559
3561
)
3560
- expected = dtype_backend_expected (string_storage , dtype_backend , conn_name )
3562
+ expected = dtype_backend_expected (string_storage , dtype_backend , conn_name )
3563
+
3561
3564
tm .assert_frame_equal (result , expected )
3562
3565
3563
3566
if "adbc" in conn_name :
@@ -3607,7 +3610,7 @@ def test_read_sql_dtype_backend_table(
3607
3610
3608
3611
with pd .option_context ("mode.string_storage" , string_storage ):
3609
3612
result = getattr (pd , func )(table , conn , dtype_backend = dtype_backend )
3610
- expected = dtype_backend_expected (string_storage , dtype_backend , conn_name )
3613
+ expected = dtype_backend_expected (string_storage , dtype_backend , conn_name )
3611
3614
tm .assert_frame_equal (result , expected )
3612
3615
3613
3616
if "adbc" in conn_name :
@@ -4123,7 +4126,7 @@ def tquery(query, con=None):
4123
4126
def test_xsqlite_basic (sqlite_buildin ):
4124
4127
frame = DataFrame (
4125
4128
np .random .default_rng (2 ).standard_normal ((10 , 4 )),
4126
- columns = Index (list ("ABCD" ), dtype = object ),
4129
+ columns = Index (list ("ABCD" )),
4127
4130
index = date_range ("2000-01-01" , periods = 10 , freq = "B" ),
4128
4131
)
4129
4132
assert sql .to_sql (frame , name = "test_table" , con = sqlite_buildin , index = False ) == 10
@@ -4150,7 +4153,7 @@ def test_xsqlite_basic(sqlite_buildin):
4150
4153
def test_xsqlite_write_row_by_row (sqlite_buildin ):
4151
4154
frame = DataFrame (
4152
4155
np .random .default_rng (2 ).standard_normal ((10 , 4 )),
4153
- columns = Index (list ("ABCD" ), dtype = object ),
4156
+ columns = Index (list ("ABCD" )),
4154
4157
index = date_range ("2000-01-01" , periods = 10 , freq = "B" ),
4155
4158
)
4156
4159
frame .iloc [0 , 0 ] = np .nan
@@ -4173,7 +4176,7 @@ def test_xsqlite_write_row_by_row(sqlite_buildin):
4173
4176
def test_xsqlite_execute (sqlite_buildin ):
4174
4177
frame = DataFrame (
4175
4178
np .random .default_rng (2 ).standard_normal ((10 , 4 )),
4176
- columns = Index (list ("ABCD" ), dtype = object ),
4179
+ columns = Index (list ("ABCD" )),
4177
4180
index = date_range ("2000-01-01" , periods = 10 , freq = "B" ),
4178
4181
)
4179
4182
create_sql = sql .get_schema (frame , "test" )
@@ -4194,7 +4197,7 @@ def test_xsqlite_execute(sqlite_buildin):
4194
4197
def test_xsqlite_schema (sqlite_buildin ):
4195
4198
frame = DataFrame (
4196
4199
np .random .default_rng (2 ).standard_normal ((10 , 4 )),
4197
- columns = Index (list ("ABCD" ), dtype = object ),
4200
+ columns = Index (list ("ABCD" )),
4198
4201
index = date_range ("2000-01-01" , periods = 10 , freq = "B" ),
4199
4202
)
4200
4203
create_sql = sql .get_schema (frame , "test" )
0 commit comments