{"language": "Python", "id": 70, "repo_owner": "dask", "repo_name": "dask", "head_branch": "milesgranger/10801-more-deprecations", "workflow_name": "Linting", "workflow_filename": "pre-commit.yml", "workflow_path": ".github/workflows/pre-commit.yml", "contributor": "milesgranger", "sha_fail": "16a0c04d06205527ec5e379df2596b399ee5dadc", "sha_success": "3716f88d477a969d0910c75b4268949af11c0e6e", "workflow": "name: Linting\n\non:\n push:\n branches: main\n pull_request:\n branches: main\n\njobs:\n checks:\n name: pre-commit hooks\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4.1.1\n - uses: actions/setup-python@v5\n with:\n python-version: '3.9'\n - uses: pre-commit/action@v3.0.0\n", "logs": [{"step_name": "pre-commit hooks/4_Run pre-commitaction@v3.0.0.txt", "log": "##[group]Run pre-commit/action@v3.0.0\nwith:\n extra_args: --all-files\nenv:\n pythonLocation: /opt/hostedtoolcache/Python/3.9.18/x64\n PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.9.18/x64/lib/pkgconfig\n Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.18/x64\n Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.18/x64\n Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.18/x64\n LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.9.18/x64/lib\n##[endgroup]\n##[group]Run python -m pip install pre-commit\n\u001b[36;1mpython -m pip install pre-commit\u001b[0m\nshell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}\nenv:\n pythonLocation: /opt/hostedtoolcache/Python/3.9.18/x64\n PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.9.18/x64/lib/pkgconfig\n Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.18/x64\n Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.18/x64\n Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.18/x64\n LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.9.18/x64/lib\n##[endgroup]\nCollecting pre-commit\n Downloading pre_commit-3.6.0-py2.py3-none-any.whl.metadata (1.3 kB)\nCollecting cfgv>=2.0.0 (from pre-commit)\n Downloading cfgv-3.4.0-py2.py3-none-any.whl.metadata (8.5 kB)\nCollecting identify>=1.0.0 (from pre-commit)\n Downloading identify-2.5.33-py2.py3-none-any.whl.metadata (4.4 kB)\nCollecting nodeenv>=0.11.1 (from pre-commit)\n Downloading nodeenv-1.8.0-py2.py3-none-any.whl.metadata (21 kB)\nCollecting pyyaml>=5.1 (from pre-commit)\n Downloading PyYAML-6.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (2.1 kB)\nCollecting virtualenv>=20.10.0 (from pre-commit)\n Downloading virtualenv-20.25.0-py3-none-any.whl.metadata (4.5 kB)\nRequirement already satisfied: setuptools in /opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages (from nodeenv>=0.11.1->pre-commit) (58.1.0)\nCollecting distlib<1,>=0.3.7 (from virtualenv>=20.10.0->pre-commit)\n Downloading distlib-0.3.8-py2.py3-none-any.whl.metadata (5.1 kB)\nCollecting filelock<4,>=3.12.2 (from virtualenv>=20.10.0->pre-commit)\n Downloading filelock-3.13.1-py3-none-any.whl.metadata (2.8 kB)\nCollecting platformdirs<5,>=3.9.1 (from virtualenv>=20.10.0->pre-commit)\n Downloading platformdirs-4.1.0-py3-none-any.whl.metadata (11 kB)\nDownloading pre_commit-3.6.0-py2.py3-none-any.whl (204 kB)\n \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501 204.0/204.0 kB 19.7 MB/s eta 0:00:00\nDownloading cfgv-3.4.0-py2.py3-none-any.whl (7.2 kB)\nDownloading identify-2.5.33-py2.py3-none-any.whl (98 kB)\n \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501 98.9/98.9 kB 27.0 MB/s eta 0:00:00\nDownloading nodeenv-1.8.0-py2.py3-none-any.whl (22 kB)\nDownloading PyYAML-6.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (738 kB)\n \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501 738.9/738.9 kB 80.2 MB/s eta 0:00:00\nDownloading virtualenv-20.25.0-py3-none-any.whl (3.8 MB)\n \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501 3.8/3.8 MB 114.1 MB/s eta 0:00:00\nDownloading distlib-0.3.8-py2.py3-none-any.whl (468 kB)\n \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501 468.9/468.9 kB 78.9 MB/s eta 0:00:00\nDownloading filelock-3.13.1-py3-none-any.whl (11 kB)\nDownloading platformdirs-4.1.0-py3-none-any.whl (17 kB)\nInstalling collected packages: distlib, pyyaml, platformdirs, nodeenv, identify, filelock, cfgv, virtualenv, pre-commit\nSuccessfully installed cfgv-3.4.0 distlib-0.3.8 filelock-3.13.1 identify-2.5.33 nodeenv-1.8.0 platformdirs-4.1.0 pre-commit-3.6.0 pyyaml-6.0.1 virtualenv-20.25.0\n\n[notice] A new release of pip is available: 23.0.1 -> 23.3.2\n[notice] To update, run: pip install --upgrade pip\n##[group]Run python -m pip freeze --local\n\u001b[36;1mpython -m pip freeze --local\u001b[0m\nshell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}\nenv:\n pythonLocation: /opt/hostedtoolcache/Python/3.9.18/x64\n PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.9.18/x64/lib/pkgconfig\n Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.18/x64\n Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.18/x64\n Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.18/x64\n LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.9.18/x64/lib\n##[endgroup]\ncfgv==3.4.0\ndistlib==0.3.8\nfilelock==3.13.1\nidentify==2.5.33\nnodeenv==1.8.0\nplatformdirs==4.1.0\npre-commit==3.6.0\nPyYAML==6.0.1\nvirtualenv==20.25.0\n##[group]Run actions/cache@v3\nwith:\n path: ~/.cache/pre-commit\n key: pre-commit-3|/opt/hostedtoolcache/Python/3.9.18/x64|2f6023be5c7e4f75d9ed9a00c3fcb4c3fa7d8493a70885078264f9accc27f632\n enableCrossOsArchive: false\n fail-on-cache-miss: false\n lookup-only: false\nenv:\n pythonLocation: /opt/hostedtoolcache/Python/3.9.18/x64\n PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.9.18/x64/lib/pkgconfig\n Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.18/x64\n Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.18/x64\n Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.18/x64\n LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.9.18/x64/lib\n##[endgroup]\nReceived 0 of 69094681 (0.0%), 0.0 MBs/sec\nCache Size: ~66 MB (69094681 B)\n[command]/usr/bin/tar -xf /home/runner/work/_temp/2e80fd5c-4883-4bdb-be22-ed0a545b7db7/cache.tzst -P -C /home/runner/work/dask/dask --use-compress-program unzstd\nReceived 69094681 of 69094681 (100.0%), 32.9 MBs/sec\nCache restored successfully\nCache restored from key: pre-commit-3|/opt/hostedtoolcache/Python/3.9.18/x64|2f6023be5c7e4f75d9ed9a00c3fcb4c3fa7d8493a70885078264f9accc27f632\n##[group]Run pre-commit run --show-diff-on-failure --color=always --all-files\n\u001b[36;1mpre-commit run --show-diff-on-failure --color=always --all-files\u001b[0m\nshell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}\nenv:\n pythonLocation: /opt/hostedtoolcache/Python/3.9.18/x64\n PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.9.18/x64/lib/pkgconfig\n Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.18/x64\n Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.18/x64\n Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.18/x64\n LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.9.18/x64/lib\n##[endgroup]\nfix end of files.........................................................\u001b[42mPassed\u001b[m\ndebug statements (python)................................................\u001b[42mPassed\u001b[m\nabsolufy-imports.........................................................\u001b[42mPassed\u001b[m\nisort....................................................................\u001b[42mPassed\u001b[m\npyupgrade................................................................\u001b[42mPassed\u001b[m\nblack....................................................................\u001b[41mFailed\u001b[m\n\u001b[2m- hook id: black\u001b[m\n\u001b[2m- files were modified by this hook\u001b[m\n\n\u001b[1mreformatted dask/utils.py\u001b[0m\n\n\u001b[1mAll done! \u2728 \ud83c\udf70 \u2728\u001b[0m\n\u001b[34m\u001b[1m1 file \u001b[0m\u001b[1mreformatted\u001b[0m, \u001b[34m257 files \u001b[0mleft unchanged.\n\nflake8...................................................................\u001b[42mPassed\u001b[m\ncodespell................................................................\u001b[42mPassed\u001b[m\nmypy.....................................................................\u001b[41mFailed\u001b[m\n\u001b[2m- hook id: mypy\u001b[m\n\u001b[2m- exit code: 1\u001b[m\n\ndask/utils.py:231: error: Unsupported operand types for + (\"str\" and \"None\") [operator]\ndask/utils.py:231: note: Right operand is of type \"Optional[str]\"\ndask/utils.py:257: error: Unsupported operand types for + (\"str\" and \"None\") [operator]\ndask/utils.py:257: note: Right operand is of type \"Optional[str]\"\nFound 2 errors in 1 file (checked 258 source files)\n\npre-commit hook(s) made changes.\nIf you are seeing this message in CI, reproduce locally with: `pre-commit run --all-files`.\nTo run `pre-commit` as part of git workflow, use `pre-commit install`.\nAll changes made by hooks:\n\u001b[1mdiff --git a/dask/utils.py b/dask/utils.py\u001b[m\n\u001b[1mindex 80ea6e8..26f1176 100644\u001b[m\n\u001b[1m--- a/dask/utils.py\u001b[m\n\u001b[1m+++ b/dask/utils.py\u001b[m\n\u001b[36m@@ -148,7 +148,7 @@\u001b[m \u001b[mdef _deprecated_kwarg(\u001b[m\n new_arg_name: str | None = None,\u001b[m\n mapping: Mapping[Any, Any] | Callable[[Any], Any] | None = None,\u001b[m\n stacklevel: int = 2,\u001b[m\n\u001b[31m- comment: str | None = None\u001b[m\n\u001b[32m+\u001b[m\u001b[32m comment: str | None = None,\u001b[m\n ) -> Callable[[F], F]:\u001b[m\n \"\"\"\u001b[m\n Decorator to deprecate a keyword argument of a function.\u001b[m\n##[error]Process completed with exit code 1.\n"}], "diff": "diff --git a/dask/utils.py b/dask/utils.py\nindex 80ea6e8d6..0da2953c8 100644\n--- a/dask/utils.py\n+++ b/dask/utils.py\n@@ -148,7 +148,7 @@ def _deprecated_kwarg(\n new_arg_name: str | None = None,\n mapping: Mapping[Any, Any] | Callable[[Any], Any] | None = None,\n stacklevel: int = 2,\n- comment: str | None = None\n+ comment: str | None = None,\n ) -> Callable[[F], F]:\n \"\"\"\n Decorator to deprecate a keyword argument of a function.\n@@ -219,7 +219,7 @@ def _deprecated_kwarg(\n \"mapping from old to new argument values must be dict or callable!\"\n )\n \n- comment = f\"\\n{comment}\" or \"\"\n+ comment_ = f\"\\n{comment}\" or \"\"\n \n def _deprecated_kwarg(func: F) -> F:\n @wraps(func)\n@@ -232,7 +232,7 @@ def _deprecated_kwarg(\n f\"the {repr(old_arg_name)} keyword is deprecated and \"\n \"will be removed in a future version. Please take \"\n f\"steps to stop the use of {repr(old_arg_name)}\"\n- ) + comment\n+ ) + comment_\n warnings.warn(msg, FutureWarning, stacklevel=stacklevel)\n kwargs[old_arg_name] = old_arg_value\n return func(*args, **kwargs)\n@@ -254,7 +254,7 @@ def _deprecated_kwarg(\n f\"use {repr(new_arg_name)} instead.\"\n )\n \n- warnings.warn(msg + comment, FutureWarning, stacklevel=stacklevel)\n+ warnings.warn(msg + comment_, FutureWarning, stacklevel=stacklevel)\n if kwargs.get(new_arg_name) is not None:\n msg = (\n f\"Can only specify {repr(old_arg_name)} \"\n", "difficulty": 0, "changed_files": ["dask/utils.py"], "commit_link": "https://github.com/dask/dask/tree/16a0c04d06205527ec5e379df2596b399ee5dadc"}