@@ -4361,38 +4361,34 @@ def test_xsqlite_if_exists(sqlite_buildin):
4361
4361
4362
4362
4363
4363
@pytest .mark .parametrize ("con" , all_connectable )
4364
- @pytest .mark .parametrize ("dtype_backend" , ["pyarrow" , "numpy_nullable" , lib .no_default ])
4365
4364
def test_bytes_column (con , dtype_backend , request ):
4366
4365
# GitHub Issue #59242
4367
4366
conn = request .getfixturevalue (con )
4368
4367
pa = pytest .importorskip ("pyarrow" )
4369
4368
4370
- dtype = "O"
4371
4369
val = b"\x01 #Eg\x89 \xab \xcd \xef \x01 #Eg\x89 \xab \xcd \xef "
4372
-
4373
4370
if "postgres" in con :
4374
- val = (
4375
- b"\x00 \x00 \x00 \x80 \x01 #Eg\x89 \xab \xcd \xef \x01 #Eg\x89 \xab \xcd \xef "
4376
- if "adbc" in con
4377
- else "0000000100100011010001010110011110001001101010"
4378
- "11110011011110111100000001001000110100010101100"
4379
- "11110001001101010111100110111101111"
4380
- )
4381
- if dtype_backend == "pyarrow" :
4382
- dtype = (
4383
- pd .ArrowDtype (pa .string ())
4384
- if "adbc" not in con
4385
- else pd .ArrowDtype (pa .opaque (pa .binary (), "bit" , "PostgreSQL" ))
4371
+ if "adbc" in con :
4372
+ val = b"\x00 \x00 \x00 \x80 \x01 #Eg\x89 \xab \xcd \xef \x01 #Eg\x89 \xab \xcd \xef "
4373
+ else :
4374
+ val = (
4375
+ "0000000100100011010001010110011110001001101010"
4376
+ "11110011011110111100000001001000110100010101100"
4377
+ "11110001001101010111100110111101111"
4386
4378
)
4387
4379
4388
- if "psycopg2" in con :
4380
+ if dtype_backend == "pyarrow" :
4381
+ dtype = pd .ArrowDtype (pa .binary ())
4382
+ if "postgres" in con :
4383
+ if "adbc" in con :
4384
+ dtype = pd .ArrowDtype (pa .opaque (pa .binary (), "bit" , "PostgreSQL" ))
4385
+ else :
4386
+ dtype = pd .ArrowDtype (pa .string ())
4387
+ else :
4388
+ dtype = "O"
4389
+ if "postgres" in con and "psycopg2" in con :
4389
4390
if dtype_backend == "numpy_nullable" :
4390
4391
dtype = pd .StringDtype ()
4391
- elif dtype_backend == lib .no_default and pd .options .future .infer_string :
4392
- dtype = pd .StringDtype (storage = "pyarrow" , na_value = np .nan )
4393
-
4394
- if "postgres" not in con and dtype_backend == "pyarrow" :
4395
- dtype = pd .ArrowDtype (pa .binary ())
4396
4392
4397
4393
expected = DataFrame ([{"a" : val }], dtype = dtype )
4398
4394
df = pd .read_sql (
0 commit comments