63
63
pytest .mark .filterwarnings (
64
64
"ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
65
65
),
66
- pytest .mark .xfail ( using_string_dtype (), reason = "TODO(infer_string)" , strict = False ) ,
66
+ pytest .mark .single_cpu ,
67
67
]
68
68
69
69
@@ -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 ]
@@ -3571,7 +3573,8 @@ def test_read_sql_dtype_backend(
3571
3573
result = getattr (pd , func )(
3572
3574
f"Select * from { table } " , conn , dtype_backend = dtype_backend
3573
3575
)
3574
- expected = dtype_backend_expected (string_storage , dtype_backend , conn_name )
3576
+ expected = dtype_backend_expected (string_storage , dtype_backend , conn_name )
3577
+
3575
3578
tm .assert_frame_equal (result , expected )
3576
3579
3577
3580
if "adbc" in conn_name :
@@ -3621,7 +3624,7 @@ def test_read_sql_dtype_backend_table(
3621
3624
3622
3625
with pd .option_context ("mode.string_storage" , string_storage ):
3623
3626
result = getattr (pd , func )(table , conn , dtype_backend = dtype_backend )
3624
- expected = dtype_backend_expected (string_storage , dtype_backend , conn_name )
3627
+ expected = dtype_backend_expected (string_storage , dtype_backend , conn_name )
3625
3628
tm .assert_frame_equal (result , expected )
3626
3629
3627
3630
if "adbc" in conn_name :
@@ -4150,7 +4153,7 @@ def tquery(query, con=None):
4150
4153
def test_xsqlite_basic (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
assert sql .to_sql (frame , name = "test_table" , con = sqlite_buildin , index = False ) == 10
@@ -4177,7 +4180,7 @@ def test_xsqlite_basic(sqlite_buildin):
4177
4180
def test_xsqlite_write_row_by_row (sqlite_buildin ):
4178
4181
frame = DataFrame (
4179
4182
np .random .default_rng (2 ).standard_normal ((10 , 4 )),
4180
- columns = Index (list ("ABCD" ), dtype = object ),
4183
+ columns = Index (list ("ABCD" )),
4181
4184
index = date_range ("2000-01-01" , periods = 10 , freq = "B" ),
4182
4185
)
4183
4186
frame .iloc [0 , 0 ] = np .nan
@@ -4200,7 +4203,7 @@ def test_xsqlite_write_row_by_row(sqlite_buildin):
4200
4203
def test_xsqlite_execute (sqlite_buildin ):
4201
4204
frame = DataFrame (
4202
4205
np .random .default_rng (2 ).standard_normal ((10 , 4 )),
4203
- columns = Index (list ("ABCD" ), dtype = object ),
4206
+ columns = Index (list ("ABCD" )),
4204
4207
index = date_range ("2000-01-01" , periods = 10 , freq = "B" ),
4205
4208
)
4206
4209
create_sql = sql .get_schema (frame , "test" )
@@ -4221,7 +4224,7 @@ def test_xsqlite_execute(sqlite_buildin):
4221
4224
def test_xsqlite_schema (sqlite_buildin ):
4222
4225
frame = DataFrame (
4223
4226
np .random .default_rng (2 ).standard_normal ((10 , 4 )),
4224
- columns = Index (list ("ABCD" ), dtype = object ),
4227
+ columns = Index (list ("ABCD" )),
4225
4228
index = date_range ("2000-01-01" , periods = 10 , freq = "B" ),
4226
4229
)
4227
4230
create_sql = sql .get_schema (frame , "test" )
0 commit comments