Skip to content

Conversation

@ueshin
Copy link
Member

@ueshin ueshin commented Nov 26, 2025

What changes were proposed in this pull request?

This is a follow-up of #53223.

Fixes a typehint using ellipsis that are not available as type arguments in Python 3.10.

Why are the changes needed?

#53223 caused a test failure in Python 3.10 tests:

  File "/__w/spark/spark/python/pyspark/testing/connectutils.py", line 312, in <module>
    ) -> Callable[[...], ...]:
         ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/pypy/pypy3.10/lib/pypy3.10/typing.py", line 1206, in __getitem__
    return self.__getitem_inner__(params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/pypy/pypy3.10/lib/pypy3.10/typing.py", line 312, in inner
    return func(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/pypy/pypy3.10/lib/pypy3.10/typing.py", line 1212, in __getitem_inner__
    result = _type_check(result, msg)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/pypy/pypy3.10/lib/pypy3.10/typing.py", line 176, in _type_check
    raise TypeError(f"{msg} Got {arg!r:.100}.")
TypeError: Callable[args, result]: result must be a type. Got Ellipsis.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

The existing tests.

Was this patch authored or co-authored using generative AI tooling?

No.

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

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

+1, LGTM. Thank you!

@ueshin ueshin changed the title [SPARK-54517][PYTHON][TESTS][FOLLOWUP] Fix a typehint using ellipsis [SPARK-54517][PYTHON][TESTS][FOLLOWUP] Fix typehints using ellipsis Nov 26, 2025
dongjoon-hyun pushed a commit that referenced this pull request Nov 26, 2025
### What changes were proposed in this pull request?

This is a follow-up of #53223.

Fixes a typehint using ellipsis that are not available as type arguments in Python 3.10.

### Why are the changes needed?

#53223 caused a test failure in Python 3.10 tests:

```
  File "/__w/spark/spark/python/pyspark/testing/connectutils.py", line 312, in <module>
    ) -> Callable[[...], ...]:
         ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/pypy/pypy3.10/lib/pypy3.10/typing.py", line 1206, in __getitem__
    return self.__getitem_inner__(params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/pypy/pypy3.10/lib/pypy3.10/typing.py", line 312, in inner
    return func(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/pypy/pypy3.10/lib/pypy3.10/typing.py", line 1212, in __getitem_inner__
    result = _type_check(result, msg)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/pypy/pypy3.10/lib/pypy3.10/typing.py", line 176, in _type_check
    raise TypeError(f"{msg} Got {arg!r:.100}.")
TypeError: Callable[args, result]: result must be a type. Got Ellipsis.
```

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

The existing tests.

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes #53238 from ueshin/issues/SPARK-54517/typehints.

Authored-by: Takuya Ueshin <ueshin@databricks.com>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
(cherry picked from commit c11edf9)
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
@dongjoon-hyun
Copy link
Member

Merged to master/4.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants