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-22313][PYTHON][FOLLOWUP] Explicitly import warnings namespace in flume.py #20110

Closed
wants to merge 1 commit into from

Conversation

HyukjinKwon
Copy link
Member

@HyukjinKwon HyukjinKwon commented Dec 29, 2017

What changes were proposed in this pull request?

This PR explicitly imports the missing warnings in flume.py.

How was this patch tested?

Manually tested.

>>> import warnings
>>> warnings.simplefilter('always', DeprecationWarning)
>>> from pyspark.streaming import flume
>>> flume.FlumeUtils.createStream(None, None, None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/.../spark/python/pyspark/streaming/flume.py", line 60, in createStream
    warnings.warn(
NameError: global name 'warnings' is not defined
>>> import warnings
>>> warnings.simplefilter('always', DeprecationWarning)
>>> from pyspark.streaming import flume
>>> flume.FlumeUtils.createStream(None, None, None)
/.../spark/python/pyspark/streaming/flume.py:65: DeprecationWarning: Deprecated in 2.3.0. Flume support is deprecated as of Spark 2.3.0. See SPARK-22142.
  DeprecationWarning)
...

@HyukjinKwon
Copy link
Member Author

cc @yhuai. Thank you for catching this.

@HyukjinKwon
Copy link
Member Author

cc @ueshin too.

@yhuai
Copy link
Contributor

yhuai commented Dec 29, 2017

Thank you! Let's also check the build result to make sure pyspark.streaming.tests.FlumePollingStreamTests is indeed triggered (I hit this issue while running this test).

@SparkQA
Copy link

SparkQA commented Dec 29, 2017

Test build #85492 has finished for PR 20110 at commit 6b73dd8.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@ueshin
Copy link
Member

ueshin commented Dec 29, 2017

LGTM for the change, but I'm not sure whether the test was indeed triggered or not.

@ueshin
Copy link
Member

ueshin commented Dec 29, 2017

I confirmed the test came to pass after the patch in my local environment.

@ueshin
Copy link
Member

ueshin commented Dec 29, 2017

Thanks! merging to master.

@asfgit asfgit closed this in 796e48c Dec 29, 2017
@HyukjinKwon
Copy link
Member Author

Thank you @yhuai and @ueshin.

@HyukjinKwon HyukjinKwon deleted the SPARK-22313-followup branch January 2, 2018 03:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants