Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
23 changes: 23 additions & 0 deletions .github/workflows/typechecking.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: "Type Checking"

on: push

jobs:
typechecking:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/[email protected]
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
pip install mypy

- name: Run type checking
run: |
mypy -p pypika --python-version ${{ matrix.python-version }}
9 changes: 5 additions & 4 deletions pypika/clickhouse/array.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import abc
from typing import Union

from pypika.terms import (
Field,
Expand Down Expand Up @@ -32,16 +33,16 @@ def get_sql(self):
class HasAny(Function):
def __init__(
self,
left_array: Array or Field,
right_array: Array or Field,
left_array: Union[Array, Field],
right_array: Union[Array, Field],
alias: str = None,
schema: str = None,
):
self._left_array = left_array
self._right_array = right_array
self.alias = alias
self.schema = schema
self.args = ()
self.args = tuple()
self.name = "hasAny"

def get_sql(self, with_alias=False, with_namespace=False, quote_char=None, dialect=None, **kwargs):
Expand All @@ -56,7 +57,7 @@ def get_sql(self, with_alias=False, with_namespace=False, quote_char=None, diale


class _AbstractArrayFunction(Function, metaclass=abc.ABCMeta):
def __init__(self, array: Array or Field, alias: str = None, schema: str = None):
def __init__(self, array: Union[Array, Field], alias: str = None, schema: str = None):
self.schema = schema
self.alias = alias
self.name = self.clickhouse_function()
Expand Down
Loading