Skip to content

Commit 32c8420

Browse files
committed
Fix annotations for older versions of Python
1 parent 2553592 commit 32c8420

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ requests
55
setuptools
66
sqlparams
77
tomli>=1.1.0; python_version < '3.11'
8+
typing_extensions<=4.13.2
89
wheel

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ install_requires =
2525
requests
2626
setuptools
2727
sqlparams
28+
typing-extensions<=4.13.2
2829
wheel
2930
tomli>=1.1.0;python_version < '3.11'
3031
python_requires = >=3.8

singlestoredb/functions/typing.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55

66
try:
77
from typing import TypeVarTuple
8+
from typing import Unpack
89
except ImportError:
910
# Python 3.8 and earlier do not have TypeVarTuple
1011
from typing_extensions import TypeVarTuple # type: ignore
12+
from typing_extensions import Unpack # type: ignore
1113

1214

1315
T = TypeVar('T', bound=Iterable[Any]) # Generic type for iterable types
@@ -32,8 +34,8 @@ def __new__(cls, *args: T) -> 'Masked[T]':
3234
Ts = TypeVarTuple('Ts')
3335

3436

35-
class Table(Tuple[*Ts]):
37+
class Table(Tuple[Unpack[Ts]]):
3638
"""Return type for a table valued function."""
3739

38-
def __new__(cls, *args: *Ts) -> 'Table[*Ts]':
40+
def __new__(cls, *args: Unpack[Ts]) -> 'Table[Unpack[Ts]]':
3941
return tuple.__new__(cls, args) # type: ignore

0 commit comments

Comments
 (0)