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 ),
64
63
]
65
64
66
65
@@ -682,6 +681,7 @@ def postgresql_psycopg2_conn(postgresql_psycopg2_engine):
682
681
683
682
@pytest .fixture
684
683
def postgresql_adbc_conn ():
684
+ pytest .importorskip ("pyarrow" )
685
685
pytest .importorskip ("adbc_driver_postgresql" )
686
686
from adbc_driver_postgresql import dbapi
687
687
@@ -814,6 +814,7 @@ def sqlite_conn_types(sqlite_engine_types):
814
814
815
815
@pytest .fixture
816
816
def sqlite_adbc_conn ():
817
+ pytest .importorskip ("pyarrow" )
817
818
pytest .importorskip ("adbc_driver_sqlite" )
818
819
from adbc_driver_sqlite import dbapi
819
820
@@ -983,13 +984,13 @@ def test_dataframe_to_sql(conn, test_frame1, request):
983
984
984
985
@pytest .mark .parametrize ("conn" , all_connectable )
985
986
def test_dataframe_to_sql_empty (conn , test_frame1 , request ):
986
- if conn == "postgresql_adbc_conn" :
987
+ if conn == "postgresql_adbc_conn" and not using_string_dtype () :
987
988
request .node .add_marker (
988
989
pytest .mark .xfail (
989
- reason = "postgres ADBC driver cannot insert index with null type" ,
990
- strict = True ,
990
+ reason = "postgres ADBC driver < 1.2 cannot insert index with null type" ,
991
991
)
992
992
)
993
+
993
994
# GH 51086 if conn is sqlite_engine
994
995
conn = request .getfixturevalue (conn )
995
996
empty_df = test_frame1 .iloc [:0 ]
@@ -3554,7 +3555,8 @@ def test_read_sql_dtype_backend(
3554
3555
result = getattr (pd , func )(
3555
3556
f"Select * from { table } " , conn , dtype_backend = dtype_backend
3556
3557
)
3557
- expected = dtype_backend_expected (string_storage , dtype_backend , conn_name )
3558
+ expected = dtype_backend_expected (string_storage , dtype_backend , conn_name )
3559
+
3558
3560
tm .assert_frame_equal (result , expected )
3559
3561
3560
3562
if "adbc" in conn_name :
@@ -3604,7 +3606,7 @@ def test_read_sql_dtype_backend_table(
3604
3606
3605
3607
with pd .option_context ("mode.string_storage" , string_storage ):
3606
3608
result = getattr (pd , func )(table , conn , dtype_backend = dtype_backend )
3607
- expected = dtype_backend_expected (string_storage , dtype_backend , conn_name )
3609
+ expected = dtype_backend_expected (string_storage , dtype_backend , conn_name )
3608
3610
tm .assert_frame_equal (result , expected )
3609
3611
3610
3612
if "adbc" in conn_name :
@@ -4120,7 +4122,7 @@ def tquery(query, con=None):
4120
4122
def test_xsqlite_basic (sqlite_buildin ):
4121
4123
frame = DataFrame (
4122
4124
np .random .default_rng (2 ).standard_normal ((10 , 4 )),
4123
- columns = Index (list ("ABCD" ), dtype = object ),
4125
+ columns = Index (list ("ABCD" )),
4124
4126
index = date_range ("2000-01-01" , periods = 10 , freq = "B" ),
4125
4127
)
4126
4128
assert sql .to_sql (frame , name = "test_table" , con = sqlite_buildin , index = False ) == 10
@@ -4147,7 +4149,7 @@ def test_xsqlite_basic(sqlite_buildin):
4147
4149
def test_xsqlite_write_row_by_row (sqlite_buildin ):
4148
4150
frame = DataFrame (
4149
4151
np .random .default_rng (2 ).standard_normal ((10 , 4 )),
4150
- columns = Index (list ("ABCD" ), dtype = object ),
4152
+ columns = Index (list ("ABCD" )),
4151
4153
index = date_range ("2000-01-01" , periods = 10 , freq = "B" ),
4152
4154
)
4153
4155
frame .iloc [0 , 0 ] = np .nan
@@ -4170,7 +4172,7 @@ def test_xsqlite_write_row_by_row(sqlite_buildin):
4170
4172
def test_xsqlite_execute (sqlite_buildin ):
4171
4173
frame = DataFrame (
4172
4174
np .random .default_rng (2 ).standard_normal ((10 , 4 )),
4173
- columns = Index (list ("ABCD" ), dtype = object ),
4175
+ columns = Index (list ("ABCD" )),
4174
4176
index = date_range ("2000-01-01" , periods = 10 , freq = "B" ),
4175
4177
)
4176
4178
create_sql = sql .get_schema (frame , "test" )
@@ -4191,7 +4193,7 @@ def test_xsqlite_execute(sqlite_buildin):
4191
4193
def test_xsqlite_schema (sqlite_buildin ):
4192
4194
frame = DataFrame (
4193
4195
np .random .default_rng (2 ).standard_normal ((10 , 4 )),
4194
- columns = Index (list ("ABCD" ), dtype = object ),
4196
+ columns = Index (list ("ABCD" )),
4195
4197
index = date_range ("2000-01-01" , periods = 10 , freq = "B" ),
4196
4198
)
4197
4199
create_sql = sql .get_schema (frame , "test" )
0 commit comments