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
2 changes: 1 addition & 1 deletion .github/workflows/code_quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ defaults:

jobs:
run_checks:
name: Run linting and formatting
name: Run linting, formatting and static type checker
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
13 changes: 11 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.13.0
rev: v0.13.3
hooks:
# Run the linter.
- id: ruff-check
# Run the formatter.
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v18.1.8 # pick the version of clang-format you want
rev: v21.1.2 # pick the version of clang-format you want
hooks:
- id: clang-format
files: \.(c|cpp|cc|h|hpp|cxx|hxx)$
Expand All @@ -19,6 +19,15 @@ repos:
hooks:
- id: cmake-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.18.2
hooks:
- id: mypy
entry: mypy -v
files: ^(duckdb/|_duckdb-stubs/)
exclude: ^duckdb/(experimental|query_graph)/
additional_dependencies: [ numpy, polars ]

- repo: local
hooks:
- id: post-checkout-submodules
Expand Down
4 changes: 2 additions & 2 deletions duckdb/polars_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ def source_generator(
for record_batch in iter(results.read_next_batch, None):
if predicate is not None and duck_predicate is None:
# We have a predicate, but did not manage to push it down, we fallback here
yield pl.from_arrow(record_batch).filter(predicate) # type: ignore[arg-type,misc]
yield pl.from_arrow(record_batch).filter(predicate) # type: ignore[arg-type,misc,unused-ignore]
else:
yield pl.from_arrow(record_batch) # type: ignore[misc]
yield pl.from_arrow(record_batch) # type: ignore[misc,unused-ignore]

return register_io_source(source_generator, schema=schema)
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ python_version = "3.9"
exclude = [
"duckdb/experimental/", # not checking the pyspark API
"duckdb/query_graph/", # old and unmaintained (should probably remove)
"tests", "scripts",
]

[[tool.mypy.overrides]]
Expand Down
14 changes: 0 additions & 14 deletions tests/stubs/mypy.ini

This file was deleted.

25 changes: 0 additions & 25 deletions tests/stubs/test_stubs.py

This file was deleted.

Loading