Skip to content
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-48560][SS][PYTHON] Make StreamingQueryListener.spark settable #46909

Closed
wants to merge 4 commits into from

Conversation

HyukjinKwon
Copy link
Member

What changes were proposed in this pull request?

This PR proposes to make StreamingQueryListener.spark settable

Why are the changes needed?

from pyspark.sql.streaming.listener import StreamingQueryListener

class MyListener(StreamingQueryListener):
  def __init__(self, spark):
    self.spark = spark

  def onQueryStarted(self, event):
    pass

  def onQueryProgress(self, event):
    pass

  def onQueryTerminated(self, event):
    pass

MyListener(spark)

is broken from 3.5.0 after SPARK-42941.

Does this PR introduce any user-facing change?

Yes, end users who implement StreamingQueryListener can add spark attribute in their implementation.

How was this patch tested?

Manually tested, and added a unittest.

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

No.

@WweiL
Copy link
Contributor

WweiL commented Jun 7, 2024

Thanks for the fix!

Copy link
Contributor

@WweiL WweiL left a comment

Choose a reason for hiding this comment

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

Pending fixing lint

@HyukjinKwon HyukjinKwon marked this pull request as draft June 9, 2024 02:16
@HyukjinKwon
Copy link
Member Author

Will fix up the test

@HyukjinKwon HyukjinKwon marked this pull request as ready for review June 9, 2024 15:14
@HyukjinKwon
Copy link
Member Author

Merged to master.

@rangadi
Copy link
Contributor

rangadi commented Jun 11, 2024

This is awesome. Thanks @HyukjinKwon .

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.

6 participants