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


   ### What changes were proposed in this pull request?
   
   This PR is a followup for both 
https://github.com/apache/spark/commit/8853f286371bcc1d44762a0a8ed5bf1a40cdbbd5 
and 
https://github.com/apache/spark/commit/88696ebcb72fd3057b1546831f653b29b7e0abb2.
 There was a logical conflict here:
   
   We should make it use `DataFrame.sparkSession` instead of `DataFrame.sql_ctx`
   
   https://github.com/apache/spark/runs/5193146096?check_suite_focus=true
   
   ```
   ======================================================================
   FAIL: test_with_columns (pyspark.sql.tests.test_dataframe.DataFrameTests)
   ----------------------------------------------------------------------
   Traceback (most recent call last):
     File "/__w/spark/spark/python/pyspark/sql/tests/test_dataframe.py", line 
484, in test_with_columns
       keys = self.df.withColumns({"key": self.df.key}).select("key").collect()
     File "/__w/spark/spark/python/pyspark/sql/dataframe.py", line 3009, in 
withColumns
       self._jdf.withColumns(_to_seq(self._sc, col_names), self._jcols(*cols)), 
self.sql_ctx
     File "/__w/spark/spark/python/pyspark/sql/dataframe.py", line 123, in 
__init__
       assert not os.environ.get("SPARK_TESTING")  # Sanity check for our 
internal usage.
   AssertionError
   
   ```
   
   ### Why are the changes needed?
   
   To fix the build, and remove deprecated usage of `SQLContext`.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No, it's not released out yet.
   
   ### How was this patch tested?
   
   CI should test it out.


-- 
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.

To unsubscribe, e-mail: [email protected]

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