Repository: burnash/gspread (branch: simplify-get-records)
Commit date: 2023-12-29T18:44:26Z

Workflow file: .github/workflows/main.yaml (lint_python)
name: lint_python
on:
  push:
    branches:
      - "**" # run all branches
    tags-ignore:
      - "*" # ignore all tags, release.yaml will trigger the CI
  pull_request: # run on all pull requests

concurrency:
  cancel-in-progress: true
  group: group-${{ github.ref_name }}

jobs:
  lint_python:
    runs-on: ubuntu-latest
    services:
      pypi_wayback:
        image: ghcr.io/waleko/pypi-wayback
        ports:
          - 8629:8080
    strategy:
      fail-fast: false
      matrix:
        python: ["3.8", "3.9", "3.10", "3.11", "3.x"]
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: ${{ matrix.python }}
      - run: pip install -U pip
      - run: pip install -U bandit mypy pyupgrade safety tox setuptools
      - run: bandit --recursive --skip B105,B110,B311,B605,B607 --exclude ./.tox .
        if: ${{ matrix.python >= '3.8' }}
      - run: tox -e lint
      - run: tox -e py
      - run: shopt -s globstar && pyupgrade --py3-only **/*.py # --py36-plus
      - run: safety check -i 42559 -i 62044 # pip <= 20.1.1, we upgrade it just above
      - run: tox -e build
      - run: tox -e doc

env:
  PIP_INDEX_URL: http://localhost:8629/2023-12-29
  UV_INDEX_URL: http://localhost:8629/2023-12-29


Failed build logs:
step_name: lint_python (3.8)/7_Run tox -e lint.txt
log: ##[group]Run tox -e lint
[36;1mtox -e lint[0m
shell: /usr/bin/bash -e {0}
env:
  pythonLocation: /opt/hostedtoolcache/Python/3.8.18/x64
  PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.8.18/x64/lib/pkgconfig
  Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.8.18/x64
  Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.8.18/x64
  Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.8.18/x64
  LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.8.18/x64/lib
##[endgroup]
lint: install_deps> python -I -m pip install -r lint-requirements.txt
.pkg: install_requires> python -I -m pip install 'flit_core<4,>=3.2'
.pkg: _optional_hooks> python /opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/pyproject_api/_backend.py True flit_core.buildapi
.pkg: get_requires_for_build_sdist> python /opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/pyproject_api/_backend.py True flit_core.buildapi
.pkg: build_sdist> python /opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/pyproject_api/_backend.py True flit_core.buildapi
lint: install_package_deps> python -I -m pip install StrEnum==0.4.15 'google-auth-oauthlib>=0.4.1' 'google-auth>=1.12.0'
lint: install_package> python -I -m pip install --force-reinstall --no-deps /home/runner/work/gspread/gspread/.tox/.pkg/dist/gspread-6.0.0.tar.gz
lint: commands[0]> black --check --diff --extend-exclude ./env .
--- /home/runner/work/gspread/gspread/gspread/worksheet.py	2023-12-29 18:49:11.002645 +0000
+++ /home/runner/work/gspread/gspread/gspread/worksheet.py	2023-12-29 18:49:38.759397 +0000
@@ -517,13 +517,14 @@
 
         if expected_headers is None:
             # all headers must be unique
             header_row_is_unique = len(keys) == len(set(keys))
             if not header_row_is_unique:
-                raise GSpreadException("the header row in the worksheet is not unique"
-                                       "try passing 'expected_headers' to get_all_records"
-                                       )
+                raise GSpreadException(
+                    "the header row in the worksheet is not unique"
+                    "try passing 'expected_headers' to get_all_records"
+                )
         else:
             # all expected headers must be unique
             expected_headers_are_unique = len(expected_headers) == len(
                 set(expected_headers)
             )
would reformat /home/runner/work/gspread/gspread/gspread/worksheet.py

Oh no! 💥 💔 💥
1 file would be reformatted, 17 files would be left unchanged.
lint: exit 1 (1.18 seconds) /home/runner/work/gspread/gspread> black --check --diff --extend-exclude ./env . pid=1934
.pkg: _exit> python /opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/pyproject_api/_backend.py True flit_core.buildapi
  lint: FAIL code 1 (11.96=setup[10.78]+cmd[1.18] seconds)
  evaluation failed :( (12.11 seconds)
##[error]Process completed with exit code 1.

step_name: lint_python (3.9)/7_Run tox -e lint.txt
log: ##[group]Run tox -e lint
[36;1mtox -e lint[0m
shell: /usr/bin/bash -e {0}
env:
  pythonLocation: /opt/hostedtoolcache/Python/3.9.18/x64
  PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.9.18/x64/lib/pkgconfig
  Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.18/x64
  Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.18/x64
  Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.18/x64
  LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.9.18/x64/lib
##[endgroup]
lint: install_deps> python -I -m pip install -r lint-requirements.txt
.pkg: install_requires> python -I -m pip install 'flit_core<4,>=3.2'
.pkg: _optional_hooks> python /opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/pyproject_api/_backend.py True flit_core.buildapi
.pkg: get_requires_for_build_sdist> python /opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/pyproject_api/_backend.py True flit_core.buildapi
.pkg: build_sdist> python /opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/pyproject_api/_backend.py True flit_core.buildapi
lint: install_package_deps> python -I -m pip install StrEnum==0.4.15 'google-auth-oauthlib>=0.4.1' 'google-auth>=1.12.0'
lint: install_package> python -I -m pip install --force-reinstall --no-deps /home/runner/work/gspread/gspread/.tox/.pkg/dist/gspread-6.0.0.tar.gz
lint: commands[0]> black --check --diff --extend-exclude ./env .
--- /home/runner/work/gspread/gspread/gspread/worksheet.py	2023-12-29 18:49:12.019448 +0000
+++ /home/runner/work/gspread/gspread/gspread/worksheet.py	2023-12-29 18:49:43.591179 +0000
@@ -517,13 +517,14 @@
 
         if expected_headers is None:
             # all headers must be unique
             header_row_is_unique = len(keys) == len(set(keys))
would reformat /home/runner/work/gspread/gspread/gspread/worksheet.py
             if not header_row_is_unique:
-                raise GSpreadException("the header row in the worksheet is not unique"
-                                       "try passing 'expected_headers' to get_all_records"
-                                       )
+                raise GSpreadException(
+                    "the header row in the worksheet is not unique"
+                    "try passing 'expected_headers' to get_all_records"
+                )
         else:
             # all expected headers must be unique
             expected_headers_are_unique = len(expected_headers) == len(
                 set(expected_headers)
             )

Oh no! 💥 💔 💥
1 file would be reformatted, 17 files would be left unchanged.
lint: exit 1 (1.31 seconds) /home/runner/work/gspread/gspread> black --check --diff --extend-exclude ./env . pid=1903
.pkg: _exit> python /opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/pyproject_api/_backend.py True flit_core.buildapi
  lint: FAIL code 1 (12.96=setup[11.66]+cmd[1.31] seconds)
  evaluation failed :( (13.20 seconds)
##[error]Process completed with exit code 1.

step_name: lint_python (3.10)/7_Run tox -e lint.txt
log: ##[group]Run tox -e lint
[36;1mtox -e lint[0m
shell: /usr/bin/bash -e {0}
env:
  pythonLocation: /opt/hostedtoolcache/Python/3.10.13/x64
  PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.10.13/x64/lib/pkgconfig
  Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.10.13/x64
  Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.10.13/x64
  Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.10.13/x64
  LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.10.13/x64/lib
##[endgroup]
lint: install_deps> python -I -m pip install -r lint-requirements.txt
.pkg: install_requires> python -I -m pip install 'flit_core<4,>=3.2'
.pkg: _optional_hooks> python /opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/pyproject_api/_backend.py True flit_core.buildapi
.pkg: get_requires_for_build_sdist> python /opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/pyproject_api/_backend.py True flit_core.buildapi
.pkg: build_sdist> python /opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/pyproject_api/_backend.py True flit_core.buildapi
lint: install_package_deps> python -I -m pip install StrEnum==0.4.15 'google-auth-oauthlib>=0.4.1' 'google-auth>=1.12.0'
lint: install_package> python -I -m pip install --force-reinstall --no-deps /home/runner/work/gspread/gspread/.tox/.pkg/dist/gspread-6.0.0.tar.gz
lint: commands[0]> black --check --diff --extend-exclude ./env .
--- /home/runner/work/gspread/gspread/gspread/worksheet.py	2023-12-29 18:49:10.826736 +0000
+++ /home/runner/work/gspread/gspread/gspread/worksheet.py	2023-12-29 18:49:40.023159 +0000
@@ -517,13 +517,14 @@
 
         if expected_headers is None:
             # all headers must be unique
             header_row_is_unique = len(keys) == len(set(keys))
             if not header_row_is_unique:
-                raise GSpreadException("the header row in the worksheet is not unique"
-                                       "try passing 'expected_headers' to get_all_records"
-                                       )
+                raise GSpreadException(
+                    "the header row in the worksheet is not unique"
+                    "try passing 'expected_headers' to get_all_records"
+                )
         else:
             # all expected headers must be unique
             expected_headers_are_unique = len(expected_headers) == len(
                 set(expected_headers)
             )
would reformat /home/runner/work/gspread/gspread/gspread/worksheet.py

Oh no! 💥 💔 💥
1 file would be reformatted, 17 files would be left unchanged.
lint: exit 1 (1.43 seconds) /home/runner/work/gspread/gspread> black --check --diff --extend-exclude ./env . pid=1907
.pkg: _exit> python /opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/pyproject_api/_backend.py True flit_core.buildapi
  lint: FAIL code 1 (13.37=setup[11.94]+cmd[1.43] seconds)
  evaluation failed :( (13.62 seconds)
##[error]Process completed with exit code 1.

step_name: lint_python (3.11)/7_Run tox -e lint.txt
log: ##[group]Run tox -e lint
[36;1mtox -e lint[0m
shell: /usr/bin/bash -e {0}
env:
  pythonLocation: /opt/hostedtoolcache/Python/3.11.7/x64
  PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.11.7/x64/lib/pkgconfig
  Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.7/x64
  Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.7/x64
  Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.7/x64
  LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.11.7/x64/lib
##[endgroup]
lint: install_deps> python -I -m pip install -r lint-requirements.txt
.pkg: install_requires> python -I -m pip install 'flit_core<4,>=3.2'
.pkg: _optional_hooks> python /opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/pyproject_api/_backend.py True flit_core.buildapi
.pkg: get_requires_for_build_sdist> python /opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/pyproject_api/_backend.py True flit_core.buildapi
.pkg: build_sdist> python /opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/pyproject_api/_backend.py True flit_core.buildapi
lint: install_package_deps> python -I -m pip install StrEnum==0.4.15 'google-auth-oauthlib>=0.4.1' 'google-auth>=1.12.0'
lint: install_package> python -I -m pip install --force-reinstall --no-deps /home/runner/work/gspread/gspread/.tox/.pkg/dist/gspread-6.0.0.tar.gz
lint: commands[0]> black --check --diff --extend-exclude ./env .
--- /home/runner/work/gspread/gspread/gspread/worksheet.py	2023-12-29 18:49:12.077791 +0000
+++ /home/runner/work/gspread/gspread/gspread/worksheet.py	2023-12-29 18:49:39.355057 +0000
@@ -517,13 +517,14 @@
would reformat /home/runner/work/gspread/gspread/gspread/worksheet.py
 
         if expected_headers is None:
             # all headers must be unique
             header_row_is_unique = len(keys) == len(set(keys))
             if not header_row_is_unique:
-                raise GSpreadException("the header row in the worksheet is not unique"
-                                       "try passing 'expected_headers' to get_all_records"
-                                       )
+                raise GSpreadException(
+                    "the header row in the worksheet is not unique"
+                    "try passing 'expected_headers' to get_all_records"
+                )
         else:
             # all expected headers must be unique
             expected_headers_are_unique = len(expected_headers) == len(
                 set(expected_headers)
             )

Oh no! 💥 💔 💥
1 file would be reformatted, 17 files would be left unchanged.
lint: exit 1 (1.19 seconds) /home/runner/work/gspread/gspread> black --check --diff --extend-exclude ./env . pid=1935
.pkg: _exit> python /opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/pyproject_api/_backend.py True flit_core.buildapi
  lint: FAIL code 1 (12.92=setup[11.72]+cmd[1.19] seconds)
  evaluation failed :( (12.98 seconds)
##[error]Process completed with exit code 1.

step_name: lint_python (3.x)/7_Run tox -e lint.txt
log: ##[group]Run tox -e lint
[36;1mtox -e lint[0m
shell: /usr/bin/bash -e {0}
env:
  pythonLocation: /opt/hostedtoolcache/Python/3.12.1/x64
  PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.12.1/x64/lib/pkgconfig
  Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.1/x64
  Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.1/x64
  Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.1/x64
  LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.12.1/x64/lib
##[endgroup]
lint: install_deps> python -I -m pip install -r lint-requirements.txt
.pkg: install_requires> python -I -m pip install 'flit_core<4,>=3.2'
.pkg: _optional_hooks> python /opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/pyproject_api/_backend.py True flit_core.buildapi
.pkg: get_requires_for_build_sdist> python /opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/pyproject_api/_backend.py True flit_core.buildapi
.pkg: build_sdist> python /opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/pyproject_api/_backend.py True flit_core.buildapi
lint: install_package_deps> python -I -m pip install StrEnum==0.4.15 'google-auth-oauthlib>=0.4.1' 'google-auth>=1.12.0'
lint: install_package> python -I -m pip install --force-reinstall --no-deps /home/runner/work/gspread/gspread/.tox/.pkg/dist/gspread-6.0.0.tar.gz
lint: commands[0]> black --check --diff --extend-exclude ./env .
--- /home/runner/work/gspread/gspread/gspread/worksheet.py	2023-12-29 18:49:11.804783 +0000
+++ /home/runner/work/gspread/gspread/gspread/worksheet.py	2023-12-29 18:49:49.027795 +0000
@@ -517,13 +517,14 @@
 
         if expected_headers is None:
             # all headers must be unique
             header_row_is_unique = len(keys) == len(set(keys))
             if not header_row_is_unique:
-                raise GSpreadException("the header row in the worksheet is not unique"
-                                       "try passing 'expected_headers' to get_all_records"
-                                       )
+                raise GSpreadException(
+                    "the header row in the worksheet is not unique"
+                    "try passing 'expected_headers' to get_all_records"
+                )
         else:
             # all expected headers must be unique
             expected_headers_are_unique = len(expected_headers) == len(
                 set(expected_headers)
             )
would reformat /home/runner/work/gspread/gspread/gspread/worksheet.py

Oh no! 💥 💔 💥
1 file would be reformatted, 17 files would be left unchanged.
lint: exit 1 (2.35 seconds) /home/runner/work/gspread/gspread> black --check --diff --extend-exclude ./env . pid=1932
.pkg: _exit> python /opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/pyproject_api/_backend.py True flit_core.buildapi
  lint: FAIL code 1 (15.07=setup[12.72]+cmd[2.35] seconds)
  evaluation failed :( (15.37 seconds)
##[error]Process completed with exit code 1.


Changed files:
gspread/worksheet.py

Fix diff:
diff --git a/gspread/worksheet.py b/gspread/worksheet.py
index d6268ea..8b4f551 100644
--- a/gspread/worksheet.py
+++ b/gspread/worksheet.py
@@ -519,9 +519,10 @@ class Worksheet:
             # all headers must be unique
             header_row_is_unique = len(keys) == len(set(keys))
             if not header_row_is_unique:
-                raise GSpreadException("the header row in the worksheet is not unique"
-                                       "try passing 'expected_headers' to get_all_records"
-                                       )
+                raise GSpreadException(
+                    "the header row in the worksheet is not unique"
+                    "try passing 'expected_headers' to get_all_records"
+                )
         else:
             # all expected headers must be unique
             expected_headers_are_unique = len(expected_headers) == len(