HyukjinKwon opened a new pull request #29768:
URL: https://github.com/apache/spark/pull/29768


   ### What changes were proposed in this pull request?
   
   In PySpark shell, if you call `SparkSession.builder.getOrCreate` as below:
   
   ```python
   import warnings
   from pyspark.sql import SparkSession, SQLContext
   warnings.simplefilter('always', DeprecationWarning)
   spark.stop()
   SparkSession.builder.getOrCreate()
   ```
   
   it shows the deprecation warning as below:
   
   ```
   /.../spark/python/pyspark/sql/context.py:72: DeprecationWarning: Deprecated 
in 3.0.0. Use SparkSession.builder.getOrCreate() instead.
     DeprecationWarning)
   ```
   
   via 
https://github.com/apache/spark/blob/d3304268d3046116d39ec3d54a8e319dce188f36/python/pyspark/sql/session.py#L222
   
   We shouldn't print the deprecation warning from it. This is the only place ^.
   
   ### Why are the changes needed?
   
   To prevent to inform users that `SparkSession.builder.getOrCreate` is 
deprecated mistakenly.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes, it won't show a deprecation warning to end users for calling 
`SparkSession.builder.getOrCreate`.
   
   ### How was this patch tested?
   
   Manually tested as above.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to