Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
xunliu committed Dec 11, 2024
1 parent 230df72 commit 26d7184
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# specific language governing permissions and limitations
# under the License.
from abc import abstractmethod
from typing import List

from gravitino.api.expressions.distributions.strategy import Strategy
from gravitino.api.expressions.expression import Expression

Expand All @@ -34,10 +36,10 @@ def number(self) -> int:
and the number is 10, then the data is distributed across 10 buckets."""

@abstractmethod
def expressions(self) -> list[Expression]:
def expressions(self) -> List[Expression]:
"""Return The expressions passed to the distribution function."""

def children(self) -> list[Expression]:
def children(self) -> List[Expression]:
"""
Returns the child expressions.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
from typing import List

from gravitino.api.expressions.distributions.strategy import Strategy
from gravitino.api.expressions.distributions.distribution import Distribution
Expand All @@ -24,9 +25,9 @@
class DistributionImpl(Distribution):
_strategy: Strategy
_number: int
_expressions: list[Expression]
_expressions: List[Expression]

def __init__(self, strategy: Strategy, number: int, expressions: list[Expression]):
def __init__(self, strategy: Strategy, number: int, expressions: List[Expression]):
self._strategy = strategy
self._number = number
self._expressions = expressions
Expand All @@ -37,7 +38,7 @@ def strategy(self) -> Strategy:
def number(self) -> int:
return self._number

def expressions(self) -> list[Expression]:
def expressions(self) -> List[Expression]:
return self._expressions

def __str__(self) -> str:
Expand Down Expand Up @@ -102,7 +103,7 @@ def of(strategy: Strategy, number: int, *expressions: Expression) -> Distributio

@staticmethod
def fields(
strategy: Strategy, number: int, *field_names: list[str]
strategy: Strategy, number: int, *field_names: List[str]
) -> Distribution:
"""
Create a distribution on columns. Like distribute by (a) or (a, b), for complex like
Expand Down
10 changes: 5 additions & 5 deletions clients/client-python/gravitino/api/expressions/expression.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

from __future__ import annotations
from abc import ABC, abstractmethod
from typing import TYPE_CHECKING
from typing import TYPE_CHECKING, List

if TYPE_CHECKING:
from gravitino.api.expressions.named_reference import NamedReference
Expand All @@ -26,23 +26,23 @@
class Expression(ABC):
"""Base class of the public logical expression API."""

EMPTY_EXPRESSION: list[Expression] = []
EMPTY_EXPRESSION: List[Expression] = []
"""
`EMPTY_EXPRESSION` is only used as an input when the default `children` method builds the result.
"""

EMPTY_NAMED_REFERENCE: list[NamedReference] = []
EMPTY_NAMED_REFERENCE: List[NamedReference] = []
"""
`EMPTY_NAMED_REFERENCE` is only used as an input when the default `references` method builds
the result array to avoid repeatedly allocating an empty array.
"""

@abstractmethod
def children(self) -> list[Expression]:
def children(self) -> List[Expression]:
"""Returns a list of the children of this node. Children should not change."""
pass

def references(self) -> list[NamedReference]:
def references(self) -> List[NamedReference]:
"""Returns a list of fields or columns that are referenced by this expression."""

ref_set: set[NamedReference] = set()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
# under the License.

import unittest
from typing import List

from gravitino.api.expressions.distributions.distributions import (
DistributionImpl,
Distributions,
Expand All @@ -27,7 +29,7 @@
class MockExpression(Expression):
"""Mock class to simulate an Expression"""

def children(self) -> list[Expression]:
def children(self) -> List[Expression]:
return Expression.EMPTY_EXPRESSION


Expand Down

0 comments on commit 26d7184

Please sign in to comment.