diff --git a/.asf.yaml b/.asf.yaml index 1bb3b2a07c8b2..e023066e42341 100644 --- a/.asf.yaml +++ b/.asf.yaml @@ -70,6 +70,9 @@ github: - cypress-matrix (4, chrome) - cypress-matrix (5, chrome) - frontend-build + - pre-commit (current) + - pre-commit (next) + - pre-commit (previous) - python-lint - test-mysql - test-postgres (current) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index af6765019250d..80afdd708bdec 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -16,6 +16,9 @@ concurrency: jobs: pre-commit: runs-on: ubuntu-22.04 + strategy: + matrix: + python-version: ["current", "next", "previous"] steps: - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" uses: actions/checkout@v4 @@ -24,6 +27,8 @@ jobs: submodules: recursive - name: Setup Python uses: ./.github/actions/setup-backend/ + with: + python-version: ${{ matrix.python-version }} - name: Enable brew and helm-docs # Add brew to the path - see https://github.com/actions/runner-images/issues/6283 run: | diff --git a/superset/commands/distributed_lock/base.py b/superset/commands/distributed_lock/base.py index 322063f54e897..8fdb402a22107 100644 --- a/superset/commands/distributed_lock/base.py +++ b/superset/commands/distributed_lock/base.py @@ -17,7 +17,7 @@ import logging import uuid -from typing import Any +from typing import Any, Union from flask import current_app @@ -34,7 +34,7 @@ class BaseDistributedLockCommand(BaseCommand): codec = JsonKeyValueCodec() resource = KeyValueResource.LOCK - def __init__(self, namespace: str, params: dict[str, Any] | None = None): + def __init__(self, namespace: str, params: Union[dict[str, Any], None] = None): self.key = get_key(namespace, **(params or {})) def validate(self) -> None: diff --git a/tests/unit_tests/db_engine_specs/test_couchbase.py b/tests/unit_tests/db_engine_specs/test_couchbase.py index 140df287324f5..06a0c9a03882b 100644 --- a/tests/unit_tests/db_engine_specs/test_couchbase.py +++ b/tests/unit_tests/db_engine_specs/test_couchbase.py @@ -16,7 +16,7 @@ # under the License. from datetime import datetime -from typing import Any, Optional +from typing import Any, Optional, Union import pytest from sqlalchemy import types @@ -84,7 +84,7 @@ def test_convert_dttm( def test_get_column_spec( native_type: str, sqla_type: type[types.TypeEngine], - attrs: dict[str, Any] | None, + attrs: Union[dict[str, Any], None], generic_type: GenericDataType, is_dttm: bool, ) -> None: