fix: mypy issue on py3.9 + prevent similar issues (#29864)

This commit is contained in:
Maxime Beauchemin 2024-08-06 10:36:23 -07:00 committed by GitHub
parent fede4f9f1b
commit c7dc4dc7fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 12 additions and 4 deletions

View File

@ -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)

View File

@ -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: |

View File

@ -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:

View File

@ -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: