Skip to content

Conversation

@ueshin
Copy link
Member

@ueshin ueshin commented Nov 25, 2025

What changes were proposed in this pull request?

This PR aims to add utility decorators in Spark Connect cross version tests.

  • skip_if_server_version_is
  • skip_if_server_version_is_greater_than_or_equal_to

Why are the changes needed?

This is a forward-port from #53222.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

N/A

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

No.

@dongjoon-hyun dongjoon-hyun changed the title [SPARK-54517][PYTHON][TESTS] Forward-port test util decorators [SPARK-54517][PYTHON][TESTS] Added utility decorators for Spark Connect parity tests Nov 26, 2025
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 and @HyukjinKwon .
Merged to master/4.1.

dongjoon-hyun pushed a commit that referenced this pull request Nov 26, 2025
…ct parity tests

### What changes were proposed in this pull request?

This PR aims to add utility decorators in Spark Connect cross version tests.

- `skip_if_server_version_is`
- `skip_if_server_version_is_greater_than_or_equal_to`

### Why are the changes needed?

This is a forward-port from #53222.

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

No.

### How was this patch tested?

N/A

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

No.

Closes #53223 from ueshin/issues/SPARK-54517/decorators.

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

dongjoon-hyun commented Nov 26, 2025

Hi, @ueshin . It seems a little weird but this PR causes some CI failures. Could you take a look at that?

https://github.com/apache/spark/actions/runs/19711591103/job/56473581543 (Python 3.10)
https://github.com/apache/spark/actions/runs/19708303738/job/56461909042 (PyPy 3.10)

  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.

@ueshin
Copy link
Member Author

ueshin commented Nov 26, 2025

@dongjoon-hyun oh, sure, let me check.

@dongjoon-hyun
Copy link
Member

Thank you so much~

@ueshin
Copy link
Member Author

ueshin commented Nov 26, 2025

Submitted the follow-up: #53238

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>
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>
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