From bd966141c9bb8b6dba3cabba3b8c8498203ed2ea Mon Sep 17 00:00:00 2001 From: Lawrence Mitchell Date: Tue, 7 May 2024 16:22:33 +0100 Subject: [PATCH] Upgrade pre commit hooks (#15685) The only really substantive change is to update mypy, which will be required for some type annotations in the cudf-polars work. Authors: - Lawrence Mitchell (https://github.com/wence-) Approvers: - GALI PREM SAGAR (https://github.com/galipremsagar) URL: https://github.com/rapidsai/cudf/pull/15685 --- .pre-commit-config.yaml | 14 +++++++------- python/cudf/cudf/core/column/column.py | 2 +- python/cudf/cudf/pandas/fast_slow_proxy.py | 5 ++--- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3e99cf3fa9a..0ae745257cb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: trailing-whitespace exclude: | @@ -24,11 +24,11 @@ repos: files: python/.* types_or: [python, cython, pyi] - repo: https://github.com/MarcoGorelli/cython-lint - rev: v0.16.0 + rev: v0.16.2 hooks: - id: cython-lint - repo: https://github.com/pre-commit/mirrors-mypy - rev: 'v1.3.0' + rev: 'v1.10.0' hooks: - id: mypy additional_dependencies: [types-cachetools] @@ -39,7 +39,7 @@ repos: "python/dask_cudf/dask_cudf"] pass_filenames: false - repo: https://github.com/nbQA-dev/nbQA - rev: 1.7.1 + rev: 1.8.5 hooks: - id: nbqa-isort # Use the cudf_kafka isort orderings in notebooks so that dask @@ -52,7 +52,7 @@ repos: types_or: [c, c++, cuda] args: ["-fallback-style=none", "-style=file", "-i"] - repo: https://github.com/sirosen/texthooks - rev: 0.6.3 + rev: 0.6.6 hooks: - id: fix-smartquotes exclude: | @@ -124,12 +124,12 @@ repos: ^CHANGELOG.md$ ) - repo: https://github.com/rapidsai/dependency-file-generator - rev: v1.8.0 + rev: v1.13.4 hooks: - id: rapids-dependency-file-generator args: ["--clean"] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.3.4 + rev: v0.4.3 hooks: - id: ruff files: python/.*$ diff --git a/python/cudf/cudf/core/column/column.py b/python/cudf/cudf/core/column/column.py index ba2dab2c2e1..553f4cc7fb3 100644 --- a/python/cudf/cudf/core/column/column.py +++ b/python/cudf/cudf/core/column/column.py @@ -2211,7 +2211,7 @@ def _mask_from_cuda_array_interface_desc(obj, cai_mask) -> Buffer: raise NotImplementedError(f"Cannot infer mask from typestr {typestr}") -def serialize_columns(columns) -> Tuple[List[dict], List]: +def serialize_columns(columns: list[ColumnBase]) -> Tuple[List[dict], List]: """ Return the headers and frames resulting from serializing a list of Column diff --git a/python/cudf/cudf/pandas/fast_slow_proxy.py b/python/cudf/cudf/pandas/fast_slow_proxy.py index 9d8c174b297..835cfa89133 100644 --- a/python/cudf/cudf/pandas/fast_slow_proxy.py +++ b/python/cudf/cudf/pandas/fast_slow_proxy.py @@ -1093,7 +1093,7 @@ def _replace_closurevars( f: types.FunctionType, attribute_name: Literal["_fsproxy_slow", "_fsproxy_fast"], seen: Set[int], -) -> types.FunctionType: +) -> Callable[..., Any]: """ Return a copy of `f` with its closure variables replaced with their corresponding slow (or fast) types. @@ -1133,12 +1133,11 @@ def _replace_closurevars( argdefs=f.__defaults__, closure=g_closure, ) - g = functools.update_wrapper( + return functools.update_wrapper( g, f, assigned=functools.WRAPPER_ASSIGNMENTS + ("__kwdefaults__",), ) - return g _SPECIAL_METHODS: Set[str] = {