Skip to content

Commit

Permalink
Fix Python 3.8 compatibility issue (#5235)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmao-denver authored Mar 7, 2024
1 parent f92c87a commit 46b5044
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions py/server/deephaven/_udf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import sys
from dataclasses import dataclass, field
from functools import wraps
from typing import Callable, List, Any, Union, Tuple, _GenericAlias
from typing import Callable, List, Any, Union, Tuple, _GenericAlias, Set

from deephaven._dep import soft_dependency

Expand All @@ -34,8 +34,8 @@
@dataclass
class _ParsedParam:
name: Union[str, int] = field(init=True)
orig_types: set[type] = field(default_factory=set)
encoded_types: set[str] = field(default_factory=set)
orig_types: Set[type] = field(default_factory=set)
encoded_types: Set[str] = field(default_factory=set)
none_allowed: bool = False
has_array: bool = False
int_char: str = None
Expand Down Expand Up @@ -266,7 +266,7 @@ def _parse_signature(fn: Callable) -> _ParsedSignature:
return p_sig


def _is_from_np_type(param_types: set[type], np_type_char: str) -> bool:
def _is_from_np_type(param_types: Set[type], np_type_char: str) -> bool:
""" Determine if the given numpy type char comes for a numpy type in the given set of parameter type annotations"""
for t in param_types:
if issubclass(t, np.generic) and np.dtype(t).char == np_type_char:
Expand Down

0 comments on commit 46b5044

Please sign in to comment.