Skip to content

Commit 7996aa3

Browse files
fix typing and sql default backend case
1 parent d834e46 commit 7996aa3

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

pandas/io/_util.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ def arrow_table_to_pandas(
5858
) -> pd.DataFrame:
5959
pa = import_optional_dependency("pyarrow")
6060

61+
types_mapper: type[pd.ArrowDtype] | None | Callable
6162
if dtype_backend == "numpy_nullable":
6263
mapping = _arrow_dtype_mapping()
6364
if null_to_int64:

pandas/io/sql.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2210,6 +2210,9 @@ def read_table(
22102210
with self.con.cursor() as cur:
22112211
cur.execute(stmt)
22122212
pa_table = cur.fetch_arrow_table()
2213+
dtype_backend = (
2214+
lib.no_default if dtype_backend == "numpy" else dtype_backend
2215+
)
22132216
df = arrow_table_to_pandas(pa_table, dtype_backend=dtype_backend)
22142217

22152218
return _wrap_result_adbc(
@@ -2281,6 +2284,9 @@ def read_query(
22812284
with self.con.cursor() as cur:
22822285
cur.execute(sql)
22832286
pa_table = cur.fetch_arrow_table()
2287+
dtype_backend = (
2288+
lib.no_default if dtype_backend == "numpy" else dtype_backend
2289+
)
22842290
df = arrow_table_to_pandas(pa_table, dtype_backend=dtype_backend)
22852291

22862292
return _wrap_result_adbc(

pandas/tests/io/test_sql.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -959,12 +959,12 @@ def sqlite_buildin_types(sqlite_buildin, types_data):
959959

960960
adbc_connectable_iris = [
961961
pytest.param("postgresql_adbc_iris", marks=pytest.mark.db),
962-
pytest.param("sqlite_adbc_iris", marks=pytest.mark.db),
962+
"sqlite_adbc_iris",
963963
]
964964

965965
adbc_connectable_types = [
966966
pytest.param("postgresql_adbc_types", marks=pytest.mark.db),
967-
pytest.param("sqlite_adbc_types", marks=pytest.mark.db),
967+
"sqlite_adbc_types",
968968
]
969969

970970

0 commit comments

Comments
 (0)