Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 4 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"]
rusackas marked this conversation as resolved.
Show resolved Hide resolved
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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

python 3.9 doesn't support the pipe operator in type hints...


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
Loading