Skip to content

Commit d804408

Browse files
Merge branch 'main' into readme-update
2 parents 19bf439 + c535a23 commit d804408

23 files changed

+194
-157
lines changed

.github/workflows/cleanup_pypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
- name: Install Astral UV
5353
uses: astral-sh/setup-uv@v6
5454
with:
55-
version: "0.7.14"
55+
version: "0.8.16"
5656

5757
- name: Run Cleanup
5858
env:

.github/workflows/coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
- name: Install Astral UV and enable the cache
7171
uses: astral-sh/setup-uv@v6
7272
with:
73-
version: "0.7.14"
73+
version: "0.8.16"
7474
python-version: 3.9
7575
enable-cache: true
7676
cache-suffix: -${{ github.workflow }}

.github/workflows/packaging.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@ jobs:
6868
testsuite: all
6969
duckdb-python-sha: ${{ inputs.duckdb-python-sha != '' && inputs.duckdb-python-sha || github.sha }}
7070
duckdb-sha: ${{ inputs.duckdb-sha }}
71-
set-version: ${{ inputs.stable-version }}
71+
set-version: ${{ inputs.set-version }}
7272

7373
build_wheels:
7474
name: Build and test releases
7575
uses: ./.github/workflows/packaging_wheels.yml
7676
with:
77-
minimal: false
77+
minimal: ${{ inputs.minimal }}
7878
testsuite: all
7979
duckdb-python-sha: ${{ inputs.duckdb-python-sha != '' && inputs.duckdb-python-sha || github.sha }}
8080
duckdb-sha: ${{ inputs.duckdb-sha }}
81-
set-version: ${{ inputs.stable-version }}
81+
set-version: ${{ inputs.set-version }}

.github/workflows/packaging_sdist.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
- name: Install Astral UV
5959
uses: astral-sh/setup-uv@v6
6060
with:
61-
version: "0.7.14"
61+
version: "0.8.16"
6262
python-version: 3.11
6363

6464
- name: Build sdist

.github/workflows/packaging_wheels.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
strategy:
3131
fail-fast: false
3232
matrix:
33-
python: [ cp39, cp310, cp311, cp312, cp313 ]
33+
python: [ cp39, cp310, cp311, cp312, cp313, cp314, cp314t ]
3434
platform:
3535
- { os: windows-2025, arch: amd64, cibw_system: win }
3636
- { os: ubuntu-24.04, arch: x86_64, cibw_system: manylinux }
@@ -45,6 +45,10 @@ jobs:
4545
- { minimal: true, python: cp311 }
4646
- { minimal: true, python: cp312 }
4747
- { minimal: true, platform: { arch: universal2 } }
48+
# Windows+cp314t disabled due to test failures in CI.
49+
# TODO: Diagnose why tests fail (access violations) in some configurations
50+
- { python: cp314t, platform: { os: windows-2025 } }
51+
4852
runs-on: ${{ matrix.platform.os }}
4953
env:
5054
CIBW_TEST_SKIP: ${{ inputs.testsuite == 'none' && '*' || '*-macosx_universal2' }}
@@ -73,22 +77,26 @@ jobs:
7377
7478
# Make sure that OVERRIDE_GIT_DESCRIBE is propagated to cibuildwhel's env, also when it's running linux builds
7579
- name: Set OVERRIDE_GIT_DESCRIBE
80+
shell: bash
7681
if: ${{ inputs.set-version != '' }}
7782
run: echo "CIBW_ENVIRONMENT=OVERRIDE_GIT_DESCRIBE=${{ inputs.set-version }}" >> $GITHUB_ENV
7883

7984
# Install Astral UV, which will be used as build-frontend for cibuildwheel
8085
- uses: astral-sh/setup-uv@v6
8186
with:
82-
version: "0.7.14"
87+
version: "0.8.16"
8388
enable-cache: false
8489
cache-suffix: -${{ matrix.python }}-${{ matrix.platform.cibw_system }}_${{ matrix.platform.arch }}
90+
python-version: ${{ matrix.python }}
8591

8692
- name: Build${{ inputs.testsuite != 'none' && ' and test ' || ' ' }}wheels
87-
uses: pypa/cibuildwheel@v3.0
93+
uses: pypa/cibuildwheel@v3.1
8894
env:
8995
CIBW_ARCHS: ${{ matrix.platform.arch == 'amd64' && 'AMD64' || matrix.platform.arch }}
9096
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.platform.cibw_system }}_${{ matrix.platform.arch }}
91-
97+
# PYTHON_GIL=1: Suppresses the RuntimeWarning that the GIL is enabled on free-threaded builds.
98+
# TODO: Remove PYTHON_GIL=1 when free-threaded is supported.
99+
CIBW_ENVIRONMENT: PYTHON_GIL=1
92100
- name: Upload wheel
93101
uses: actions/upload-artifact@v4
94102
with:

.github/workflows/release.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ jobs:
146146
publish_pypi:
147147
name: Publish Artifacts to PyPI
148148
runs-on: ubuntu-latest
149-
if: ${{ !always() }}
150149
needs: [workflow_state, build_sdist, build_wheels]
151150
environment:
152151
name: ${{ needs.workflow_state.outputs.ci_env }}

duckdb/__init__.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,49 @@ def version():
1818
"functional"
1919
])
2020

21+
class DBAPITypeObject:
22+
def __init__(self, types: list[typing.DuckDBPyType]) -> None:
23+
self.types = types
24+
25+
def __eq__(self, other):
26+
if isinstance(other, typing.DuckDBPyType):
27+
return other in self.types
28+
return False
29+
30+
def __repr__(self):
31+
return f"<DBAPITypeObject [{','.join(str(x) for x in self.types)}]>"
32+
33+
# Define the standard DBAPI sentinels
34+
STRING = DBAPITypeObject([typing.VARCHAR])
35+
NUMBER = DBAPITypeObject([
36+
typing.TINYINT,
37+
typing.UTINYINT,
38+
typing.SMALLINT,
39+
typing.USMALLINT,
40+
typing.INTEGER,
41+
typing.UINTEGER,
42+
typing.BIGINT,
43+
typing.UBIGINT,
44+
typing.HUGEINT,
45+
typing.UHUGEINT,
46+
typing.DuckDBPyType("BIGNUM"),
47+
typing.DuckDBPyType("DECIMAL"),
48+
typing.FLOAT,
49+
typing.DOUBLE
50+
])
51+
DATETIME = DBAPITypeObject([
52+
typing.DATE,
53+
typing.TIME,
54+
typing.TIME_TZ,
55+
typing.TIMESTAMP,
56+
typing.TIMESTAMP_TZ,
57+
typing.TIMESTAMP_NS,
58+
typing.TIMESTAMP_MS,
59+
typing.TIMESTAMP_S
60+
])
61+
BINARY = DBAPITypeObject([typing.BLOB])
62+
ROWID = None
63+
2164
# Classes
2265
from _duckdb import (
2366
DuckDBPyRelation,

external/duckdb

Submodule duckdb updated 53 files

pyproject.toml

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ all = [ # users can install duckdb with 'duckdb[all]', which will install this l
4646
"ipython", # used in duckdb.query_graph
4747
"fsspec", # used in duckdb.filesystem
4848
"numpy", # used in duckdb.experimental.spark and in duckdb.fetchnumpy()
49-
"pandas", # used for pandas dataframes all over the place
50-
"pyarrow", # used for pyarrow support
51-
"adbc_driver_manager", # for the adbc driver (TODO: this should live under the duckdb package)
49+
"pandas; python_version < '3.14'", # used for pandas dataframes all over the place
50+
"pyarrow; python_version < '3.14'", # used for pyarrow support
51+
"adbc_driver_manager; python_version < '3.14'", # for the adbc driver (TODO: this should live under the duckdb package)
5252
]
5353

5454
######################################################################################################
@@ -123,7 +123,6 @@ if.env.COVERAGE = false
123123
inherit.cmake.define = "append"
124124
cmake.define.DISABLE_UNITY = "1"
125125

126-
127126
[tool.scikit-build.sdist]
128127
include = [
129128
"README.md",
@@ -204,6 +203,7 @@ required-environments = [ # ... but do always resolve for all of them
204203
"python_version >= '3.9' and sys_platform == 'linux' and platform_machine == 'x86_64'",
205204
"python_version >= '3.9' and sys_platform == 'linux' and platform_machine == 'aarch64'",
206205
]
206+
prerelease = "if-necessary-or-explicit" # for 3.14
207207

208208
# We just need pytorch for tests, wihtout GPU acceleration. PyPI doesn't host a cpu-only version for Linux, so we have
209209
# to configure the index url for cpu-only pytorch manually
@@ -219,31 +219,31 @@ torchvision = [ { index = "pytorch-cpu" } ]
219219
[dependency-groups] # used for development only, requires pip >=25.1.0
220220
stubdeps = [ # dependencies used for typehints in the stubs
221221
"fsspec",
222-
"pandas",
223-
"polars",
224-
"pyarrow",
222+
"pandas; python_version < '3.14'",
223+
"polars; python_version < '3.14'",
224+
"pyarrow; python_version < '3.14'",
225225
]
226226
test = [ # dependencies used for running tests
227227
"pytest",
228228
"pytest-reraise",
229229
"pytest-timeout",
230230
"mypy",
231231
"coverage",
232-
"gcovr",
232+
"gcovr; python_version < '3.14'",
233233
"gcsfs",
234234
"packaging",
235-
"polars",
235+
"polars; python_version < '3.14'",
236236
"psutil",
237237
"py4j",
238238
"pyotp",
239-
"pyspark",
239+
"pyspark; python_version < '3.14'",
240240
"pytz",
241241
"requests",
242242
"urllib3",
243243
"fsspec>=2022.11.0",
244-
"pandas>=2.0.0",
245-
"pyarrow>=18.0.0",
246-
"torch>=2.2.2; sys_platform != 'darwin' or platform_machine != 'x86_64' or python_version < '3.13'",
244+
"pandas>=2.0.0; python_version < '3.14'",
245+
"pyarrow>=18.0.0; python_version < '3.14'",
246+
"torch>=2.2.2; python_version < '3.14' and (sys_platform != 'darwin' or platform_machine != 'x86_64' or python_version < '3.13')",
247247
"tensorflow==2.14.0; sys_platform == 'darwin' and python_version < '3.12'",
248248
"tensorflow-cpu>=2.14.0; sys_platform == 'linux' and platform_machine != 'aarch64' and python_version < '3.12'",
249249
"tensorflow-cpu>=2.14.0; sys_platform == 'win32' and python_version < '3.12'",
@@ -256,10 +256,10 @@ scripts = [ # dependencies used for running scripts
256256
"ipython",
257257
"ipywidgets",
258258
"numpy",
259-
"pandas",
259+
"pandas; python_version < '3.14'",
260260
"pcpp",
261-
"polars",
262-
"pyarrow",
261+
"polars; python_version < '3.14'",
262+
"pyarrow; python_version < '3.14'",
263263
"pytz"
264264
]
265265
pypi = [ # dependencies used by the pypi cleanup script
@@ -379,6 +379,7 @@ manylinux-x86_64-image = "manylinux_2_28"
379379
manylinux-pypy_x86_64-image = "manylinux_2_28"
380380
manylinux-aarch64-image = "manylinux_2_28"
381381
manylinux-pypy_aarch64-image = "manylinux_2_28"
382+
enable = ["cpython-freethreading", "cpython-prerelease"]
382383

383384
[tool.cibuildwheel.linux]
384385
before-build = ["yum install -y ccache"]

src/duckdb_py/pandas/analyzer.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -502,12 +502,6 @@ bool PandasAnalyzer::Analyze(py::object column) {
502502
if (sample_size == 0) {
503503
return false;
504504
}
505-
auto &import_cache = *DuckDBPyConnection::ImportCache();
506-
auto pandas = import_cache.pandas();
507-
if (!pandas) {
508-
//! Pandas is not installed, no need to analyze
509-
return false;
510-
}
511505

512506
bool can_convert = true;
513507
idx_t increment = GetSampleIncrement(py::len(column));

0 commit comments

Comments
 (0)