-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-47276][PYTHON][CONNECT] Introduce spark.profile.clear for SparkSession-based profiling
#45378
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
Conversation
spark.profile.clear for SparkSession-based profilingspark.profile.clear for SparkSession-based profiling
|
Failed tests are irrelevant to changes proposed in this PR. Rerun failed tests https://github.com/xinrong-meng/spark/actions/runs/8162084262. |
| """ | ||
| Clear the perf profile results. | ||
| .. versionadded:: 4.0.0 |
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.
Is this a user-facing API? If not, we don't need this version directive
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.
It is a user-facing API, along with profile.show and profile.dump. We will also add it to API doc.
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.
Actually this is not. The clear in Profile should be a user-facing API.
HyukjinKwon
left a comment
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.
Seems fine but cc @ueshin
ueshin
left a comment
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.
Otherwise, LGTM, pending tests.
| }, | ||
| ) | ||
|
|
||
| def test_clear_memory_type(self): |
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.
nit, it seems we don't have a parity test for test_session. does it make sense to move SparkSessionProfileTests out of test_session and add parity test for it?
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.
Good idea!
For now, all logic tested by SparkSessionProfileTests is directly imported in Spark Connect with no modification. But I do agree separating it later will improve readability and ensure future parity. I'll refactor later. Thanks!
|
Merged to master, thank you all! |
What changes were proposed in this pull request?
Introduce
spark.profile.clearfor SparkSession-based profiling.Why are the changes needed?
A straightforward and unified interface for managing and resetting profiling results for SparkSession-based profilers.
Does this PR introduce any user-facing change?
Yes.
spark.profile.clearis supported as shown below.Preparation:
Example usage:
How was this patch tested?
Unit tests.
Was this patch authored or co-authored using generative AI tooling?
No.