Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions .github/actions/ccache-action/action.yml

This file was deleted.

127 changes: 8 additions & 119 deletions .github/workflows/packaging_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,112 +25,15 @@ on:
type: string

jobs:
seed_wheels:
name: 'Seed: cp314-${{ matrix.platform.cibw_system }}_${{ matrix.platform.arch }}'
strategy:
fail-fast: false
matrix:
python: [ cp314 ]
platform:
- { os: windows-2022, arch: amd64, cibw_system: win }
- { os: windows-11-arm, arch: ARM64, cibw_system: win }
- { os: ubuntu-24.04, arch: x86_64, cibw_system: manylinux }
- { os: ubuntu-24.04-arm, arch: aarch64, cibw_system: manylinux }
- { os: macos-15, arch: arm64, cibw_system: macosx }
- { os: macos-15, arch: universal2, cibw_system: macosx }
- { os: macos-15-intel, arch: x86_64, cibw_system: macosx }
minimal:
- ${{ inputs.minimal }}
exclude:
- { minimal: true, platform: { arch: universal2 } }
runs-on: ${{ matrix.platform.os }}
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
### cibuildwheel configuration
#
# This is somewhat brittle, so be careful with changes. Some notes for our future selves (and others):
# - cibw will change its cwd to a temp dir and create a separate venv for testing. It then installs the wheel it
# built into that venv, and run the CIBW_TEST_COMMAND. We have to install all dependencies ourselves, and make
# sure that the pytest config in pyproject.toml is available.
# - CIBW_BEFORE_TEST installs the test dependencies by exporting them into a pylock.toml. At the time of writing,
# `uv sync --no-install-project` had problems correctly resolving dependencies using resolution environments
# across all platforms we build for. This might be solved in newer uv versions.
# - CIBW_TEST_COMMAND specifies pytest conf from pyproject.toml. --confcutdir is needed to prevent pytest from
# traversing the full filesystem, which produces an error on Windows.
# - CIBW_TEST_SKIP we always skip tests for *-macosx_universal2 builds, because we run tests for arm64 and x86_64.
CIBW_TEST_SKIP: ${{ inputs.testsuite == 'none' && '*' || '*-macosx_universal2' }}
CIBW_TEST_SOURCES: tests
CIBW_BEFORE_TEST: >
uv export --only-group test --no-emit-project --quiet --output-file pylock.toml --directory {project} &&
uv pip install -r pylock.toml
CIBW_TEST_COMMAND: >
uv run -v pytest --confcutdir=. --rootdir . -c {project}/pyproject.toml ${{ inputs.testsuite == 'fast' && './tests/fast' || './tests' }}

steps:
- name: Checkout DuckDB Python
uses: actions/checkout@v4
with:
ref: ${{ inputs.duckdb-python-sha }}
fetch-depth: 0
submodules: true

- name: Checkout DuckDB
shell: bash
if: ${{ inputs.duckdb-sha }}
run: |
cd external/duckdb
git fetch origin
git checkout ${{ inputs.duckdb-sha }}

- name: Set CIBW_ENVIRONMENT
shell: bash
run: |
cibw_env=""
if [[ "${{ matrix.platform.cibw_system }}" == "manylinux" ]]; then
cibw_env="CCACHE_DIR=/host${{ github.workspace }}/.ccache"
fi
if [[ -n "${{ inputs.set-version }}" ]]; then
cibw_env="${cibw_env:+$cibw_env }OVERRIDE_GIT_DESCRIBE=${{ inputs.set-version }}"
fi
if [[ -n "$cibw_env" ]]; then
echo "CIBW_ENVIRONMENT=${cibw_env}" >> $GITHUB_ENV
fi

- name: Setup Ccache
uses: ./.github/actions/ccache-action
with:
key: ${{ matrix.platform.cibw_system }}_${{ matrix.platform.arch }}

# Install Astral UV, which will be used as build-frontend for cibuildwheel
- uses: astral-sh/setup-uv@v7
with:
version: "0.9.0"
enable-cache: false
cache-suffix: -${{ matrix.python }}-${{ matrix.platform.cibw_system }}_${{ matrix.platform.arch }}

- name: Build${{ inputs.testsuite != 'none' && ' and test ' || ' ' }}wheels
uses: pypa/cibuildwheel@v3.2
env:
CIBW_ARCHS: ${{ matrix.platform.arch == 'amd64' && 'AMD64' || matrix.platform.arch }}
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.platform.cibw_system }}_${{ matrix.platform.arch }}

- name: Upload wheel
uses: actions/upload-artifact@v4
with:
name: wheel-${{ matrix.python }}-${{ matrix.platform.cibw_system }}_${{ matrix.platform.arch }}
path: wheelhouse/*.whl
compression-level: 0

build_wheels:
name: 'Wheel: ${{ matrix.python }}-${{ matrix.platform.cibw_system }}_${{ matrix.platform.arch }}'
needs: seed_wheels
strategy:
fail-fast: false
matrix:
python: [ cp310, cp311, cp312, cp313 ]
python: [ cp310, cp311, cp312, cp313, cp314 ]
platform:
- { os: windows-2025, arch: amd64, cibw_system: win }
- { os: windows-11-arm, arch: ARM64, cibw_system: win }
- { os: windows-2022, arch: amd64, cibw_system: win }
- { os: windows-11-arm, arch: ARM64, cibw_system: win } # cibw requires ARM64 to be uppercase
- { os: ubuntu-24.04, arch: x86_64, cibw_system: manylinux }
- { os: ubuntu-24.04-arm, arch: aarch64, cibw_system: manylinux }
- { os: macos-15, arch: arm64, cibw_system: macosx }
Expand All @@ -143,10 +46,9 @@ jobs:
- { minimal: true, python: cp312 }
- { minimal: true, python: cp313 }
- { minimal: true, platform: { arch: universal2 } }
- { python: cp310, platform: { os: windows-11-arm, arch: ARM64 } }
- { python: cp310, platform: { os: windows-11-arm, arch: ARM64 } } # too many dependency problems for win arm64
runs-on: ${{ matrix.platform.os }}
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
### cibuildwheel configuration
#
# This is somewhat brittle, so be careful with changes. Some notes for our future selves (and others):
Expand Down Expand Up @@ -183,24 +85,11 @@ jobs:
git fetch origin
git checkout ${{ inputs.duckdb-sha }}

- name: Set CIBW_ENVIRONMENT
# Make sure that OVERRIDE_GIT_DESCRIBE is propagated to cibuildwhel's env, also when it's running linux builds
- name: Set OVERRIDE_GIT_DESCRIBE
shell: bash
run: |
cibw_env=""
if [[ "${{ matrix.platform.cibw_system }}" == "manylinux" ]]; then
cibw_env="CCACHE_DIR=/host${{ github.workspace }}/.ccache"
fi
if [[ -n "${{ inputs.set-version }}" ]]; then
cibw_env="${cibw_env:+$cibw_env }OVERRIDE_GIT_DESCRIBE=${{ inputs.set-version }}"
fi
if [[ -n "$cibw_env" ]]; then
echo "CIBW_ENVIRONMENT=${cibw_env}" >> $GITHUB_ENV
fi

- name: Setup Ccache
uses: ./.github/actions/ccache-action
with:
key: ${{ matrix.platform.cibw_system }}_${{ matrix.platform.arch }}
if: ${{ inputs.set-version != '' }}
run: echo "CIBW_ENVIRONMENT=OVERRIDE_GIT_DESCRIBE=${{ inputs.set-version }}" >> $GITHUB_ENV

# Install Astral UV, which will be used as build-frontend for cibuildwheel
- uses: astral-sh/setup-uv@v7
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ defaults:
jobs:
build_sdist:
name: Build an sdist and determine versions
if: ${{ github.ref != 'refs/heads/main' }}
uses: ./.github/workflows/packaging_sdist.yml
with:
testsuite: all
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ cmake_minimum_required(VERSION 3.29)

project(duckdb_py LANGUAGES CXX)

# Always use C++17
set(CMAKE_CXX_STANDARD 17)
# Always use C++11
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
Expand Down
4 changes: 1 addition & 3 deletions _duckdb-stubs/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -537,9 +537,7 @@ class DuckDBPyRelation:
def distinct(self) -> DuckDBPyRelation: ...
def except_(self, other_rel: Self) -> DuckDBPyRelation: ...
def execute(self) -> DuckDBPyRelation: ...
def explain(
self, type: ExplainType | ExplainTypeLiteral = ExplainType.STANDARD, format: str | None = None
) -> str: ...
def explain(self, type: ExplainType | ExplainTypeLiteral = ExplainType.STANDARD) -> str: ...
def favg(
self, expression: str, groups: str = "", window_spec: str = "", projected_columns: str = ""
) -> DuckDBPyRelation: ...
Expand Down
8 changes: 2 additions & 6 deletions duckdb/experimental/spark/sql/type_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
IntegerType,
LongType,
MapType,
NullType,
ShortType,
StringType,
StructField,
Expand All @@ -28,7 +27,6 @@
TimeNTZType,
TimestampMillisecondNTZType,
TimestampNanosecondNTZType,
TimestampNanosecondType,
TimestampNTZType,
TimestampSecondNTZType,
TimestampType,
Expand All @@ -43,7 +41,6 @@
)

_sqltype_to_spark_class = {
"null": NullType,
"boolean": BooleanType,
"utinyint": UnsignedByteType,
"tinyint": ByteType,
Expand All @@ -65,10 +62,9 @@
"time with time zone": TimeType,
"timestamp": TimestampNTZType,
"timestamp with time zone": TimestampType,
"timestamp_ms": TimestampMillisecondNTZType,
"timestamp_ns": TimestampNanosecondNTZType,
"timestamp_ms": TimestampNanosecondNTZType,
"timestamp_ns": TimestampMillisecondNTZType,
"timestamp_s": TimestampSecondNTZType,
"timestamptz_ns": TimestampNanosecondType,
"interval": DayTimeIntervalType,
"list": ArrayType,
"struct": StructType,
Expand Down
21 changes: 0 additions & 21 deletions duckdb/experimental/spark/sql/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
"TimestampMillisecondNTZType",
"TimestampNTZType",
"TimestampNanosecondNTZType",
"TimestampNanosecondType",
"TimestampSecondNTZType",
"TimestampType",
"UUIDType",
Expand Down Expand Up @@ -240,26 +239,6 @@ def fromInternal(self, ts: int) -> datetime.datetime: # noqa: D102
return datetime.datetime.fromtimestamp(ts // 1000000).replace(microsecond=ts % 1000000)


class TimestampNanosecondType(AtomicType, metaclass=DataTypeSingleton):
"""Timestamp (datetime.datetime) data type with timezone information with nanosecond precision."""

def __init__(self) -> None: # noqa: D107
super().__init__(DuckDBPyType("TIMESTAMPTZ_NS"))

def needConversion(self) -> bool: # noqa: D102
return True

@classmethod
def typeName(cls) -> str: # noqa: D102
return "timestamptz_ns"

def toInternal(self, dt: datetime.datetime) -> int: # noqa: D102
raise ContributionsAcceptedError

def fromInternal(self, ts: int) -> datetime.datetime: # noqa: D102
raise ContributionsAcceptedError


class TimestampNTZType(AtomicType, metaclass=DataTypeSingleton):
"""Timestamp (datetime.datetime) data type without timezone information with microsecond precision."""

Expand Down
2 changes: 1 addition & 1 deletion duckdb_packaging/setuptools_scm_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from ._versioning import format_version, parse_version

# MAIN_BRANCH_VERSIONING should be 'True' on main branch only
MAIN_BRANCH_VERSIONING = True
MAIN_BRANCH_VERSIONING = False

SCM_PRETEND_ENV_VAR = "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_DUCKDB"
SCM_GLOBAL_PRETEND_ENV_VAR = "SETUPTOOLS_SCM_PRETEND_VERSION"
Expand Down
8 changes: 1 addition & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,6 @@ version_scheme = "duckdb_packaging.setuptools_scm_version:version_scheme"
local_scheme = "no-local-version"
fallback_version = "0.0.1.dev1"

# main only: count dev distance from the last *minor* tag (v*.*.0), so a patch
# tag (e.g. v1.5.4) merged in from a release branch can't reset .devN.
# Release branches must NOT have this, they correctly count from v*.*.* (the default).
[tool.setuptools_scm.scm.git]
describe_command = "git describe --dirty --tags --long --abbrev=40 --match v*.*.0"

# Override: if COVERAGE is set then:
# - we create a RelWithDebInfo build
# - we make sure we use a persistent build dir so we get access to the .gcda files
Expand Down Expand Up @@ -128,7 +122,7 @@ cmake.build-type = "Debug"
[[tool.scikit-build.overrides]]
if.state = "editable"
if.env.COVERAGE = false
if.platform-system = "(?i)darwin"
if.platform-system = "Darwin"
inherit.cmake.define = "append"
cmake.define.DISABLE_UNITY = "1"

Expand Down
16 changes: 1 addition & 15 deletions scripts/cache_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -532,9 +532,7 @@
"polars.DataFrame",
"polars.LazyFrame",
"polars.col",
"polars.lit",
"polars.Series",
"polars.Decimal"
"polars.lit"
],
"required": false
},
Expand Down Expand Up @@ -824,17 +822,5 @@
"full_path": "polars.lit",
"name": "lit",
"children": []
},
"polars.Series": {
"type": "attribute",
"full_path": "polars.Series",
"name": "Series",
"children": []
},
"polars.Decimal": {
"type": "attribute",
"full_path": "polars.Decimal",
"name": "Decimal",
"children": []
}
}
2 changes: 0 additions & 2 deletions scripts/imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@
polars.LazyFrame
polars.col
polars.lit
polars.Series
polars.Decimal

import duckdb
import duckdb.filesystem
Expand Down
5 changes: 2 additions & 3 deletions src/duckdb_py/arrow/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# this is used for clang-tidy checks
add_library(
python_arrow OBJECT
arrow_array_stream.cpp arrow_export_utils.cpp filter_pushdown_visitor.cpp
polars_filter_pushdown.cpp pyarrow_filter_pushdown.cpp)
python_arrow OBJECT arrow_array_stream.cpp arrow_export_utils.cpp
polars_filter_pushdown.cpp pyarrow_filter_pushdown.cpp)

target_link_libraries(python_arrow PRIVATE _duckdb_dependencies)
Loading
Loading