Skip to content

Commit

Permalink
[SPARK-48372][SPARK-45716][PYTHON][FOLLOW-UP] Remove unused helper me…
Browse files Browse the repository at this point in the history
…thod

### What changes were proposed in this pull request?
followup of #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 <[email protected]>
Signed-off-by: Ruifeng Zheng <[email protected]>
  • Loading branch information
zhengruifeng committed Jun 11, 2024
1 parent 452c1b6 commit df4156a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
8 changes: 0 additions & 8 deletions python/pyspark/sql/connect/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -1844,14 +1844,6 @@ def isStreaming(self) -> bool:
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))
Expand Down
2 changes: 1 addition & 1 deletion python/pyspark/sql/tests/connect/test_connect_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ def test_toDF(self):

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)
Expand Down

0 comments on commit df4156a

Please sign in to comment.