Skip to content

Commit 83aa04a

Browse files
committed
Enable pyarrow with python 3.14
1 parent fd1c34f commit 83aa04a

File tree

2 files changed

+4
-46
lines changed

2 files changed

+4
-46
lines changed

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ all = [ # users can install duckdb with 'duckdb[all]', which will install this l
4848
"fsspec", # used in duckdb.filesystem
4949
"numpy", # used in duckdb.experimental.spark and in duckdb.fetchnumpy()
5050
"pandas", # used for pandas dataframes all over the place
51-
"pyarrow; python_version < '3.14'", # used for pyarrow support
51+
"pyarrow", # used for pyarrow support
5252
"adbc-driver-manager", # for the adbc driver
5353
]
5454

@@ -226,7 +226,7 @@ stubdeps = [ # dependencies used for typehints in the stubs
226226
"fsspec",
227227
"pandas",
228228
"polars",
229-
"pyarrow; python_version < '3.14'",
229+
"pyarrow",
230230
]
231231
test = [ # dependencies used for running tests
232232
"adbc-driver-manager",
@@ -248,7 +248,7 @@ test = [ # dependencies used for running tests
248248
"urllib3",
249249
"fsspec>=2022.11.0",
250250
"pandas>=2.0.0",
251-
"pyarrow>=18.0.0; python_version < '3.14'",
251+
"pyarrow>=18.0.0",
252252
"torch>=2.2.2; python_version < '3.14' and ( sys_platform != 'darwin' or platform_machine != 'x86_64' or python_version < '3.13' )",
253253
"tensorflow==2.14.0; sys_platform == 'darwin' and python_version < '3.12'",
254254
"tensorflow-cpu>=2.14.0; sys_platform == 'linux' and platform_machine != 'aarch64' and python_version < '3.12'",
@@ -265,7 +265,7 @@ scripts = [ # dependencies used for running scripts
265265
"pandas",
266266
"pcpp",
267267
"polars",
268-
"pyarrow; python_version < '3.14'",
268+
"pyarrow",
269269
"pytz"
270270
]
271271
pypi = [ # dependencies used by the pypi cleanup script

tests/conftest.py

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import os
2-
import sys
32
import warnings
43
from importlib import import_module
54
from pathlib import Path
@@ -36,47 +35,6 @@ def import_pandas():
3635
pytest.skip("Couldn't import pandas")
3736

3837

39-
@pytest.hookimpl(hookwrapper=True)
40-
def pytest_runtest_call(item):
41-
"""Convert missing pyarrow imports to skips.
42-
43-
TODO(evertlammerts): Remove skip when pyarrow releases for 3.14.
44-
https://github.com/duckdblabs/duckdb-internal/issues/6182
45-
"""
46-
outcome = yield
47-
if sys.version_info[:2] == (3, 14):
48-
try:
49-
outcome.get_result()
50-
except ImportError as e:
51-
if e.name == "pyarrow":
52-
pytest.skip(f"pyarrow not available - {item.name} requires pyarrow")
53-
else:
54-
raise
55-
56-
57-
@pytest.hookimpl(hookwrapper=True)
58-
def pytest_make_collect_report(collector):
59-
"""Wrap module collection to catch pyarrow import errors on Python 3.14.
60-
61-
If we're on Python 3.14 and a test module raises ModuleNotFoundError
62-
for 'pyarrow', mark the entire module as xfailed rather than failing collection.
63-
64-
TODO(evertlammerts): Remove skip when pyarrow releases for 3.14.
65-
https://github.com/duckdblabs/duckdb-internal/issues/6182
66-
"""
67-
outcome = yield
68-
report: pytest.CollectReport = outcome.get_result()
69-
70-
if sys.version_info[:2] == (3, 14):
71-
# Only handle failures from module collectors
72-
if report.failed and collector.__class__.__name__ == "Module":
73-
longreprtext = report.longreprtext
74-
if "ModuleNotFoundError: No module named 'pyarrow'" in longreprtext:
75-
report.outcome = "skipped"
76-
reason = f"XFAIL: [pyarrow not available] {longreprtext}"
77-
report.longrepr = (report.fspath, None, reason)
78-
79-
8038
# https://docs.pytest.org/en/latest/example/simple.html#control-skipping-of-tests-according-to-command-line-option
8139
# https://stackoverflow.com/a/47700320
8240
def pytest_addoption(parser):

0 commit comments

Comments
 (0)