GitHub user HyukjinKwon opened a pull request:
https://github.com/apache/spark/pull/20110
[SPARK-22313][PYTHON][FOLLOWUP] Explicitly import warnings namespace in
flume.py
## 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.
```python
>>> 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
```
```python
>>> 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)
```
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/HyukjinKwon/spark SPARK-22313-followup
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/20110.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #20110
----
commit 6b73dd8b2d47f8ae218bbab4eeb696684cdac138
Author: hyukjinkwon <gurwls223@...>
Date: 2017-12-29T02:27:15Z
Explicitly import warnings in flume.py
----
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]