panbingkun commented on PR #49054:
URL: https://github.com/apache/spark/pull/49054#issuecomment-2519619548

   Thank you for fixing it. I also encountered this issue while verifying a bug.
   ```shell
   (pyspark) ➜  spark-community git:(master) ✗ ./bin/pyspark --remote 
"sc://127.0.0.1:8888"
   Python 3.12.7 | packaged by conda-forge | (main, Oct  4 2024, 15:57:01) 
[Clang 17.0.6 ] on darwin
   Type "help", "copyright", "credits" or "license" for more information.
   
/Users/panbingkun/Developer/spark/spark-community/python/pyspark/shell.py:77: 
UserWarning: Failed to initialize Spark session.
     warnings.warn("Failed to initialize Spark session.")
   Traceback (most recent call last):
     File 
"/Users/panbingkun/Developer/spark/spark-community/python/pyspark/shell.py", 
line 52, in <module>
       spark = SparkSession.builder.getOrCreate()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/Users/panbingkun/Developer/spark/spark-community/python/pyspark/sql/session.py",
 line 495, in getOrCreate
       from pyspark.sql.connect.session import SparkSession as 
RemoteSparkSession
     File 
"/Users/panbingkun/Developer/spark/spark-community/python/pyspark/sql/connect/session.py",
 line 53, in <module>
       from pyspark.sql.connect.dataframe import DataFrame
     File 
"/Users/panbingkun/Developer/spark/spark-community/python/pyspark/sql/connect/dataframe.py",
 line 75, in <module>
       from pyspark.sql.connect.group import GroupedData
     File 
"/Users/panbingkun/Developer/spark/spark-community/python/pyspark/sql/connect/group.py",
 line 43, in <module>
       from pyspark.sql.connect.functions import builtin as F
     File 
"/Users/panbingkun/Developer/spark/spark-community/python/pyspark/sql/connect/functions/__init__.py",
 line 22, in <module>
       from pyspark.sql.connect.functions.builtin import *  # noqa: F401,F403
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/Users/panbingkun/Developer/spark/spark-community/python/pyspark/sql/connect/functions/builtin.py",
 line 62, in <module>
       from pyspark.sql.connect.udf import _create_py_udf
     File 
"/Users/panbingkun/Developer/spark/spark-community/python/pyspark/sql/connect/udf.py",
 line 38, in <module>
       from pyspark.sql.connect.column import Column
     File 
"/Users/panbingkun/Developer/spark/spark-community/python/pyspark/sql/connect/column.py",
 line 110, in <module>
       @with_origin_to_class(["to_plan"])
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/Users/panbingkun/Developer/spark/spark-community/python/pyspark/errors/utils.py",
 line 313, in <lambda>
       return lambda cls: with_origin_to_class(cls, ignores)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/Users/panbingkun/Developer/spark/spark-community/python/pyspark/errors/utils.py",
 line 318, in with_origin_to_class
       and is_debugging_enabled()
           ^^^^^^^^^^^^^^^^^^^^^^
     File 
"/Users/panbingkun/Developer/spark/spark-community/python/pyspark/errors/utils.py",
 line 56, in is_debugging_enabled
       spark = SparkSession.getActiveSession()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/Users/panbingkun/Developer/spark/spark-community/python/pyspark/sql/utils.py",
 line 344, in wrapped
       from pyspark.sql.connect.session import SparkSession
   ImportError: cannot import name 'SparkSession' from partially initialized 
module 'pyspark.sql.connect.session' (most likely due to a circular import) 
(/Users/panbingkun/Developer/spark/spark-community/python/pyspark/sql/connect/session.py)
   ```


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