Skip to content

Commit

Permalink
fix: mypy issue on py3.9 + prevent similar issues (#29864)
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch authored Aug 6, 2024
1 parent fede4f9 commit c7dc4dc
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .asf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: |
Expand Down
4 changes: 2 additions & 2 deletions superset/commands/distributed_lock/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import logging
import uuid
from typing import Any
from typing import Any, Union

from flask import current_app

Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions tests/unit_tests/db_engine_specs/test_couchbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit c7dc4dc

Please sign in to comment.