Skip to content

Commit

Permalink
[SPARK-42065][PYTHON][CONNECT][TESTS] Remove duplicated `test_freqIte…
Browse files Browse the repository at this point in the history
…ms` test

### What changes were proposed in this pull request?
Remove one of the `test_freqItems` functions.

### Why are the changes needed?
The same code have be copied.

https://github.com/apache/spark/blob/e6c01cedbecebdc40863e552862beee1bd959710/python/pyspark/sql/tests/connect/test_connect_plan.py#L316

https://github.com/apache/spark/blob/e6c01cedbecebdc40863e552862beee1bd959710/python/pyspark/sql/tests/connect/test_connect_plan.py#L334

### Does this PR introduce _any_ user-facing change?
No.

### How was this patch tested?
Pass GA

Closes #39573 from bjornjorgensen/remove_test_freqItems.

Authored-by: bjornjorgensen <bjornjorgensen@gmail.com>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
  • Loading branch information
bjornjorgensen authored and HyukjinKwon committed Jan 15, 2023
1 parent db68958 commit 58ce4b7
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions python/pyspark/sql/tests/connect/test_connect_plan.py
Expand Up @@ -331,24 +331,6 @@ def test_freqItems(self):
self.assertEqual(plan.root.freq_items.cols, ["col_a", "col_b"])
self.assertEqual(plan.root.freq_items.support, 0.01)

def test_freqItems(self):
df = self.connect.readTable(table_name=self.tbl_name)
plan = (
df.filter(df.col_name > 3).freqItems(["col_a", "col_b"], 1)._plan.to_proto(self.connect)
)
self.assertEqual(plan.root.freq_items.cols, ["col_a", "col_b"])
self.assertEqual(plan.root.freq_items.support, 1)
plan = df.filter(df.col_name > 3).freqItems(["col_a", "col_b"])._plan.to_proto(self.connect)
self.assertEqual(plan.root.freq_items.cols, ["col_a", "col_b"])
self.assertEqual(plan.root.freq_items.support, 0.01)

plan = df.stat.freqItems(["col_a", "col_b"], 1)._plan.to_proto(self.connect)
self.assertEqual(plan.root.freq_items.cols, ["col_a", "col_b"])
self.assertEqual(plan.root.freq_items.support, 1)
plan = df.stat.freqItems(["col_a", "col_b"])._plan.to_proto(self.connect)
self.assertEqual(plan.root.freq_items.cols, ["col_a", "col_b"])
self.assertEqual(plan.root.freq_items.support, 0.01)

def test_limit(self):
df = self.connect.readTable(table_name=self.tbl_name)
limit_plan = df.limit(10)._plan.to_proto(self.connect)
Expand Down

0 comments on commit 58ce4b7

Please sign in to comment.