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

ruifengz 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 df4156aa3217 [SPARK-48372][SPARK-45716][PYTHON][FOLLOW-UP] Remove 
unused helper method
df4156aa3217 is described below

commit df4156aa3217cf0f58b4c6cbf33c967bb43f7155
Author: Ruifeng Zheng <ruife...@apache.org>
AuthorDate: Tue Jun 11 18:45:02 2024 +0800

    [SPARK-48372][SPARK-45716][PYTHON][FOLLOW-UP] Remove unused helper method
    
    ### What changes were proposed in this pull request?
    followup of https://github.com/apache/spark/pull/46685, to remove unused 
helper method
    
    ### Why are the changes needed?
    method `_tree_string` is no longer needed
    
    ### Does this PR introduce _any_ user-facing change?
    No, internal change only
    
    ### How was this patch tested?
    CI
    
    ### Was this patch authored or co-authored using generative AI tooling?
    No
    
    Closes #46936 from zhengruifeng/tree_string_followup.
    
    Authored-by: Ruifeng Zheng <ruife...@apache.org>
    Signed-off-by: Ruifeng Zheng <ruife...@apache.org>
---
 python/pyspark/sql/connect/dataframe.py                | 8 --------
 python/pyspark/sql/tests/connect/test_connect_basic.py | 2 +-
 2 files changed, 1 insertion(+), 9 deletions(-)

diff --git a/python/pyspark/sql/connect/dataframe.py 
b/python/pyspark/sql/connect/dataframe.py
index 6fbb57f3ec61..baac1523c709 100644
--- a/python/pyspark/sql/connect/dataframe.py
+++ b/python/pyspark/sql/connect/dataframe.py
@@ -1844,14 +1844,6 @@ class DataFrame(ParentDataFrame):
         assert result is not None
         return result
 
-    def _tree_string(self, level: Optional[int] = None) -> str:
-        query = self._plan.to_proto(self._session.client)
-        result = self._session.client._analyze(
-            method="tree_string", plan=query, level=level
-        ).tree_string
-        assert result is not None
-        return result
-
     def printSchema(self, level: Optional[int] = None) -> None:
         if level:
             print(self.schema.treeString(level))
diff --git a/python/pyspark/sql/tests/connect/test_connect_basic.py 
b/python/pyspark/sql/tests/connect/test_connect_basic.py
index 74d08424cafc..598c76a5b25f 100755
--- a/python/pyspark/sql/tests/connect/test_connect_basic.py
+++ b/python/pyspark/sql/tests/connect/test_connect_basic.py
@@ -568,7 +568,7 @@ class SparkConnectBasicTests(SparkConnectSQLTestCase):
 
     def test_print_schema(self):
         # SPARK-41216: Test print schema
-        tree_str = self.connect.sql("SELECT 1 AS X, 2 AS Y")._tree_string()
+        tree_str = self.connect.sql("SELECT 1 AS X, 2 AS 
Y").schema.treeString()
         # root
         #  |-- X: integer (nullable = false)
         #  |-- Y: integer (nullable = false)


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

Reply via email to