Skip to content

Commit 25d4b77

Browse files
committed
Merge remote-tracking branch 'upstream/main' into free_threading_314t
2 parents 1b338cd + df7789c commit 25d4b77

358 files changed

Lines changed: 13722 additions & 13148 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.githooks/post-checkout

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#!/bin/sh
2-
if [ "$3" = "1" ]; then
3-
echo "Updating submodules..."
4-
git submodule update --init --recursive
5-
fi
1+
#!/usr/bin/env bash
62

3+
git submodule update --init --recursive
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Create or Label Mirror Issue
2+
on:
3+
discussion:
4+
types:
5+
- labeled
6+
issues:
7+
types:
8+
- labeled
9+
10+
env:
11+
GH_TOKEN: ${{ secrets.DUCKDBLABS_BOT_TOKEN }}
12+
TITLE_PREFIX: "[duckdb-python/#${{ github.event.issue.number || github.event.discussion.number }}]"
13+
PUBLIC_ISSUE_TITLE: ${{ github.event.issue.title }}
14+
15+
jobs:
16+
add_needs_reproducible_example_comment:
17+
if: github.event.label.name == 'needs reproducible example'
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Add comment
21+
run: |
22+
cat > needs-reproducible-example-comment.md << EOF
23+
Thanks for opening this issue in the DuckDB-Python project's issue tracker! To resolve this issue, our team needs a reproducible example. This includes:
24+
25+
* A source code snippet which reproduces the issue.
26+
* The snippet should be self-contained, i.e., it should contain all imports and should use relative paths instead of hard coded paths (please avoid \`/Users/JohnDoe/...\`).
27+
* A lot of issues can be reproduced with plain SQL code executed in the [DuckDB command line client](https://duckdb.org/docs/api/cli/overview). For such issues, please open an issue in the [main DuckDB repository](https://github.com/duckdb/duckdb/).
28+
* If the script needs additional data, please share the data as a CSV, JSON, or Parquet file. Unfortunately, we cannot fix issues that can only be reproduced with a confidential data set. [Support contracts](https://duckdblabs.com/#support) allow sharing confidential data with the core DuckDB team under NDA.
29+
30+
For more detailed guidelines on how to create reproducible examples, please visit Stack Overflow's [“Minimal, Reproducible Example”](https://stackoverflow.com/help/minimal-reproducible-example) page.
31+
EOF
32+
gh issue comment --repo duckdb/duckdb-python ${{ github.event.issue.number || github.event.discussion.number }} --body-file needs-reproducible-example-comment.md
33+
34+
create_or_label_mirror_issue:
35+
if: github.event.label.name == 'reproduced' || github.event.label.name == 'under review'
36+
runs-on: ubuntu-latest
37+
steps:
38+
- name: Remove 'needs triage' / 'under review' if 'reproduced'
39+
if: github.event.label.name == 'reproduced'
40+
run: |
41+
gh issue edit --repo duckdb/duckdb-python ${{ github.event.issue.number || github.event.discussion.number }} --remove-label "needs triage" --remove-label "under review" --remove-label "needs reproducible example"
42+
43+
- name: Remove 'needs triage' / 'reproduced' if 'under review'
44+
if: github.event.label.name == 'under review'
45+
run: |
46+
gh issue edit --repo duckdb/duckdb-python ${{ github.event.issue.number || github.event.discussion.number }} --remove-label "needs triage" --remove-label "reproduced"
47+
48+
- name: Remove 'needs triage' if 'expected behavior'
49+
if: github.event.label.name == 'expected behavior'
50+
run: |
51+
gh issue edit --repo duckdb/duckdb-python ${{ github.event.issue.number || github.event.discussion.number }} --remove-label "needs triage"
52+
53+
- name: Get mirror issue number
54+
run: |
55+
gh issue list --repo duckdblabs/duckdb-internal --search "${TITLE_PREFIX}" --json title,number --state all --jq ".[] | select(.title | startswith(\"$TITLE_PREFIX\")).number" > mirror_issue_number.txt
56+
echo "MIRROR_ISSUE_NUMBER=$(cat mirror_issue_number.txt)" >> $GITHUB_ENV
57+
58+
- name: Print whether mirror issue exists
59+
run: |
60+
if [ "$MIRROR_ISSUE_NUMBER" == "" ]; then
61+
echo "Mirror issue with title prefix '$TITLE_PREFIX' does not exist yet"
62+
else
63+
echo "Mirror issue with title prefix '$TITLE_PREFIX' exists with number $MIRROR_ISSUE_NUMBER"
64+
fi
65+
66+
- name: Set label environment variable
67+
run: |
68+
if ${{ github.event.label.name == 'reproduced' }}; then
69+
echo "LABEL=reproduced" >> $GITHUB_ENV
70+
echo "UNLABEL=under review" >> $GITHUB_ENV
71+
else
72+
echo "LABEL=under review" >> $GITHUB_ENV
73+
echo "UNLABEL=reproduced" >> $GITHUB_ENV
74+
fi
75+
76+
- name: Create or label issue
77+
run: |
78+
if [ "$MIRROR_ISSUE_NUMBER" == "" ]; then
79+
gh issue create --repo duckdblabs/duckdb-internal --label "$LABEL" --label "Python" --title "$TITLE_PREFIX - $PUBLIC_ISSUE_TITLE" --body "See https://github.com/duckdb/duckdb-python/issues/${{ github.event.issue.number || github.event.discussion.number }}"
80+
else
81+
gh issue edit --repo duckdblabs/duckdb-internal $MIRROR_ISSUE_NUMBER --remove-label "$UNLABEL" --add-label "$LABEL"
82+
fi
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Update Mirror Issue
2+
on:
3+
discussion:
4+
types:
5+
- labeled
6+
issues:
7+
types:
8+
- closed
9+
- reopened
10+
11+
env:
12+
GH_TOKEN: ${{ secrets.DUCKDBLABS_BOT_TOKEN }}
13+
TITLE_PREFIX: "[duckdb-python/#${{ github.event.issue.number || github.event.discussion.number }}]"
14+
15+
jobs:
16+
update_mirror_issue:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Get mirror issue number
20+
run: |
21+
gh issue list --repo duckdblabs/duckdb-internal --search "${TITLE_PREFIX}" --json title,number --state all --jq ".[] | select(.title | startswith(\"$TITLE_PREFIX\")).number" > mirror_issue_number.txt
22+
echo "MIRROR_ISSUE_NUMBER=$(cat mirror_issue_number.txt)" >> $GITHUB_ENV
23+
24+
- name: Print whether mirror issue exists
25+
run: |
26+
if [ "$MIRROR_ISSUE_NUMBER" == "" ]; then
27+
echo "Mirror issue with title prefix '$TITLE_PREFIX' does not exist yet"
28+
else
29+
echo "Mirror issue with title prefix '$TITLE_PREFIX' exists with number $MIRROR_ISSUE_NUMBER"
30+
fi
31+
32+
- name: Add comment with status to mirror issue
33+
run: |
34+
if [ "$MIRROR_ISSUE_NUMBER" != "" ]; then
35+
gh issue comment --repo duckdblabs/duckdb-internal $MIRROR_ISSUE_NUMBER --body "The issue has been ${{ github.event.action }} (https://github.com/duckdb/duckdb-python/issues/${{ github.event.issue.number || github.event.discussion.number }})."
36+
fi
37+
38+
- name: Add closed label to mirror issue
39+
if: github.event.action == 'closed'
40+
run: |
41+
if [ "$MIRROR_ISSUE_NUMBER" != "" ]; then
42+
gh issue edit --repo duckdblabs/duckdb-internal $MIRROR_ISSUE_NUMBER --add-label "public closed" --remove-label "public reopened"
43+
fi
44+
45+
- name: Reopen mirror issue and add reopened label
46+
if: github.event.action == 'reopened'
47+
run: |
48+
if [ "$MIRROR_ISSUE_NUMBER" != "" ]; then
49+
gh issue reopen --repo duckdblabs/duckdb-internal $MIRROR_ISSUE_NUMBER
50+
gh issue edit --repo duckdblabs/duckdb-internal $MIRROR_ISSUE_NUMBER --add-label "public reopened" --remove-label "public closed"
51+
fi

.github/workflows/code_quality.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Code Quality Checks
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
git_ref:
6+
type: string
7+
description: Git ref of the DuckDB python package
8+
required: false
9+
workflow_call:
10+
inputs:
11+
git_ref:
12+
type: string
13+
description: Git ref of the DuckDB python package
14+
required: false
15+
16+
defaults:
17+
run:
18+
shell: bash
19+
20+
jobs:
21+
run_checks:
22+
name: Run linting, formatting and static type checker
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
with:
27+
ref: ${{ inputs.git_ref }}
28+
fetch-depth: 0
29+
persist-credentials: false
30+
31+
- name: Install Astral UV
32+
uses: astral-sh/setup-uv@v6
33+
with:
34+
version: "0.7.14"
35+
python-version: 3.9
36+
37+
- name: pre-commit (cache)
38+
uses: actions/cache@v4
39+
with:
40+
path: ~/.cache/pre-commit
41+
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
42+
43+
- name: pre-commit (--all-files)
44+
run: |
45+
uvx pre-commit run --show-diff-on-failure --color=always --all-files

.github/workflows/coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,4 +151,4 @@ jobs:
151151
echo "### C++ Coverage Summary" >> $GITHUB_STEP_SUMMARY
152152
echo '```' >> $GITHUB_STEP_SUMMARY
153153
echo "$SUMMARY_CPP" >> $GITHUB_STEP_SUMMARY
154-
echo '```' >> $GITHUB_STEP_SUMMARY
154+
echo '```' >> $GITHUB_STEP_SUMMARY

.github/workflows/on_pr.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,14 @@ jobs:
2323
name: Make sure submodule is in a sane state
2424
uses: ./.github/workflows/submodule_sanity.yml
2525

26+
code_quality:
27+
name: Code-quality checks
28+
needs: submodule_sanity_guard
29+
uses: ./.github/workflows/code_quality.yml
30+
2631
packaging_test:
2732
name: Build a minimal set of packages and run all tests on them
28-
needs: submodule_sanity_guard
33+
needs: code_quality
2934
# Skip packaging tests for draft PRs
3035
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
3136
uses: ./.github/workflows/packaging.yml
@@ -36,7 +41,7 @@ jobs:
3641

3742
coverage_test:
3843
name: Run coverage tests
39-
needs: submodule_sanity_guard
44+
needs: code_quality
4045
# Only run coverage test for draft PRs
4146
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.draft == true }}
4247
uses: ./.github/workflows/coverage.yml

.github/workflows/on_push.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,13 @@ concurrency:
1818
cancel-in-progress: true
1919

2020
jobs:
21+
code_quality:
22+
name: Code-quality checks
23+
uses: ./.github/workflows/code_quality.yml
24+
2125
test:
2226
name: Run coverage tests
27+
needs: code_quality
2328
uses: ./.github/workflows/coverage.yml
2429
with:
2530
git_ref: ${{ github.ref }}

.github/workflows/packaging_wheels.yml

Lines changed: 1 addition & 5 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, cp314, cp314t ]
33+
python: [ cp39, cp310, cp311, cp312, cp313, cp314 ]
3434
platform:
3535
- { os: windows-2025, arch: amd64, cibw_system: win }
3636
- { os: ubuntu-24.04, arch: x86_64, cibw_system: manylinux }
@@ -45,10 +45,6 @@ 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-
5248
runs-on: ${{ matrix.platform.os }}
5349
env:
5450
CIBW_TEST_SKIP: ${{ inputs.testsuite == 'none' && '*' || '*-macosx_universal2' }}

.pre-commit-config.yaml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.4.0
4+
hooks:
5+
- id: check-yaml
6+
args: ["--allow-multiple-documents"]
7+
- id: check-toml
8+
- id: check-added-large-files
9+
- id: detect-private-key
10+
- id: check-merge-conflict
11+
- id: forbid-new-submodules
12+
13+
- repo: https://github.com/astral-sh/ruff-pre-commit
14+
# Ruff version.
15+
rev: v0.13.3
16+
hooks:
17+
# Run the linter.
18+
- id: ruff-check
19+
# Run the formatter.
20+
- id: ruff-format
21+
22+
- repo: https://github.com/pre-commit/mirrors-clang-format
23+
rev: v21.1.2 # pick the version of clang-format you want
24+
hooks:
25+
- id: clang-format
26+
files: \.(c|cpp|cc|h|hpp|cxx|hxx)$
27+
28+
- repo: https://github.com/cheshirekow/cmake-format-precommit
29+
rev: v0.6.13
30+
hooks:
31+
- id: cmake-format
32+
33+
- repo: https://github.com/pre-commit/mirrors-mypy
34+
rev: v1.18.2
35+
hooks:
36+
- id: mypy
37+
entry: mypy -v
38+
files: ^(duckdb/|_duckdb-stubs/)
39+
exclude: ^duckdb/(experimental|query_graph)/
40+
additional_dependencies: [ numpy, polars ]
41+
42+
- repo: local
43+
hooks:
44+
- id: post-checkout-submodules
45+
name: Update submodule post-checkout
46+
entry: .githooks/post-checkout
47+
language: script
48+
stages: [ post-checkout ]
49+
pass_filenames: false
50+
always_run: true

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Changelog
2+
3+
## v1.4.1
4+
**DuckDB Core**: v1.4.1
5+
6+
### Bug Fixes
7+
- **ADBC Driver**: Fixed ADBC driver implementation (#81)
8+
- **SQLAlchemy compatibility**: Added `__hash__` method overload (#61)
9+
- **Error Handling**: Reset PyErr before throwing Python exceptions (#69)
10+
- **Polars Lazyframes**: Fixed Polars expression pushdown (#102)
11+
12+
### Code Quality Improvements & Developer Experience
13+
- **MyPy Support**: MyPy is functional again and better integrated with the dev workflow
14+
- **Stubs**: Re-created and manually curated stubs for the binary extension
15+
- **Type Shadowing**: Deprecated `typing` and `functional` modules
16+
- **Linting & Formatting**: Comprehensive code quality improvements with Ruff
17+
- **Type Annotations**: Added missing overloads and improved type coverage
18+
- **Pre-commit Integration**: Added ruff, clang-format, cmake-format and mypy configs
19+
- **CI/CD**: Added code quality workflow

0 commit comments

Comments
 (0)