This is an automated email from the ASF dual-hosted git repository.

gurwls223 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new c43cb76fc57 [SPARK-41366][CONNECT][FOLLOWUP] Import `Column` if pandas 
is available
c43cb76fc57 is described below

commit c43cb76fc5742e9f7b5d49a9390bf4a85bc42324
Author: Dongjoon Hyun <dongj...@apache.org>
AuthorDate: Thu Dec 8 16:26:30 2022 +0900

    [SPARK-41366][CONNECT][FOLLOWUP] Import `Column` if pandas is available
    
    ### What changes were proposed in this pull request?
    
    This is a follow-up to move `Column` import statement in order to a test 
issue
    
    ### Why are the changes needed?
    
    `Column` requires `pandas` dependency.
    ```
    $ python/run-tests.py --modules pyspark-connect
    ...
      File 
"/Users/dongjoon/APACHE/spark-merge/python/pyspark/sql/tests/connect/test_connect_basic.py",
 line 24, in <module>
        from pyspark.sql.connect.column import Column
      File 
"/Users/dongjoon/APACHE/spark-merge/python/pyspark/sql/connect/__init__.py", 
line 22, in <module>
        from pyspark.sql.connect.dataframe import DataFrame  # noqa: F401
      File 
"/Users/dongjoon/APACHE/spark-merge/python/pyspark/sql/connect/dataframe.py", 
line 33, in <module>
        import pandas
    ModuleNotFoundError: No module named 'pandas'
    ```
    
    ### Does this PR introduce _any_ user-facing change?
    
    No. This is a test-only fix.
    
    ### How was this patch tested?
    
    Manually tests on a system without `pandas`.
    ```
    $ python/run-tests.py --modules pyspark-connect
    ```
    
    Closes #38976 from dongjoon-hyun/SPARK-41366.
    
    Authored-by: Dongjoon Hyun <dongj...@apache.org>
    Signed-off-by: Hyukjin Kwon <gurwls...@apache.org>
---
 python/pyspark/sql/tests/connect/test_connect_basic.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/python/pyspark/sql/tests/connect/test_connect_basic.py 
b/python/pyspark/sql/tests/connect/test_connect_basic.py
index 9c8b0f1ca2b..3681a9980b9 100644
--- a/python/pyspark/sql/tests/connect/test_connect_basic.py
+++ b/python/pyspark/sql/tests/connect/test_connect_basic.py
@@ -21,7 +21,6 @@ import tempfile
 
 import grpc  # type: ignore
 
-from pyspark.sql.connect.column import Column
 from pyspark.testing.sqlutils import have_pandas, SQLTestUtils
 
 if have_pandas:
@@ -33,6 +32,7 @@ from pyspark.sql.types import StructType, StructField, 
LongType, StringType
 if have_pandas:
     from pyspark.sql.connect.session import SparkSession as RemoteSparkSession
     from pyspark.sql.connect.client import ChannelBuilder
+    from pyspark.sql.connect.column import Column
     from pyspark.sql.connect.dataframe import DataFrame as CDataFrame
     from pyspark.sql.connect.function_builder import udf
     from pyspark.sql.connect.functions import lit, col


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to