Skip to content

[SPARK-51101][ML][PYTHON][CONNECT][TESTS] Add doctest for pyspark.ml.connect.functions#49821

Closed
zhengruifeng wants to merge 5 commits intoapache:masterfrom
zhengruifeng:ml_connect_function_doc_tests
Closed

[SPARK-51101][ML][PYTHON][CONNECT][TESTS] Add doctest for pyspark.ml.connect.functions#49821
zhengruifeng wants to merge 5 commits intoapache:masterfrom
zhengruifeng:ml_connect_function_doc_tests

Conversation

@zhengruifeng
Copy link
Contributor

What changes were proposed in this pull request?

Add doctest for pyspark.ml.connect.functions

Why are the changes needed?

to improve the test coverage

Does this PR introduce any user-facing change?

no, test-only

How was this patch tested?

ci

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

no

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@HyukjinKwon I want to test the doctest of predict_batch_udf in connect mode, it seems I have to add a dummy function here. Is there some elegant way to do this?

Copy link
Member

Choose a reason for hiding this comment

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

I think we can just have a function predict_batch_udf that calls PyMLFunctions.predict_batch_udf

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good idea!

@zhengruifeng zhengruifeng force-pushed the ml_connect_function_doc_tests branch from 957e9fa to 17cd70f Compare February 6, 2025 02:18
@zhengruifeng
Copy link
Contributor Author

cc @HyukjinKwon would you mind taking another look?

@xinrong-meng
Copy link
Member

LGTM thank you!

zhengruifeng added a commit that referenced this pull request Feb 7, 2025
….connect.functions`

### What changes were proposed in this pull request?
Add doctest for `pyspark.ml.connect.functions`

### Why are the changes needed?
to improve the test coverage

### Does this PR introduce _any_ user-facing change?
no, test-only

### How was this patch tested?
ci

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

Closes #49821 from zhengruifeng/ml_connect_function_doc_tests.

Authored-by: Ruifeng Zheng <ruifengz@apache.org>
Signed-off-by: Ruifeng Zheng <ruifengz@apache.org>
(cherry picked from commit 935c2b0)
Signed-off-by: Ruifeng Zheng <ruifengz@apache.org>
@zhengruifeng
Copy link
Contributor Author

thanks @xinrong-meng and @HyukjinKwon

merged to master

@zhengruifeng zhengruifeng deleted the ml_connect_function_doc_tests branch February 7, 2025 02:28
zifeif2 pushed a commit to zifeif2/spark that referenced this pull request Nov 14, 2025
….connect.functions`

### What changes were proposed in this pull request?
Add doctest for `pyspark.ml.connect.functions`

### Why are the changes needed?
to improve the test coverage

### Does this PR introduce _any_ user-facing change?
no, test-only

### How was this patch tested?
ci

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

Closes apache#49821 from zhengruifeng/ml_connect_function_doc_tests.

Authored-by: Ruifeng Zheng <ruifengz@apache.org>
Signed-off-by: Ruifeng Zheng <ruifengz@apache.org>
(cherry picked from commit 9d1b69d)
Signed-off-by: Ruifeng Zheng <ruifengz@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants