-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-13302][PYSPARK][TESTS] Move the temp file creation and cleanup outside of the doctests #11197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-13302][PYSPARK][TESTS] Move the temp file creation and cleanup outside of the doctests #11197
Conversation
…ts self and into the test init for ML
|
Test build #51245 has finished for PR 11197 at commit
|
|
cc @mengxr who was interested in this cleanup |
| try: | ||
| (failure_count, test_count) = doctest.testmod(globs=globs, optionflags=doctest.ELLIPSIS) | ||
| sc.stop() | ||
| finally: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the try ... finally is not necessary because it does not handle any exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So finally is still useful even if we don't explicitly catch/handle any exceptions - are you saying the sc.stop and doctest will never throw any exceptions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for misunderstand, I think your are right.
|
@holdenk I like this cleanup, thanks for the effort. |
|
LGTM |
|
great :) |
|
maybe @mengxr if you've got a chance to take a look at this? |
|
or @davies or @jkbradley maybe? |
|
Test build #51486 has finished for PR 11197 at commit
|
|
Merged to master |
Some of the new doctests in ml/clustering.py have a lot of setup code, move the setup code to the general test init to keep the doctest more example-style looking.
In part this is a follow up to #10999
Note that the same pattern is followed in regression & recommendation - might as well clean up all three at the same time.