You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by do...@apache.org on 2023/12/07 23:04:17 UTC
(spark) branch master updated: [SPARK-46309][PS][TESTS] Remove unused code in `pyspark.pandas.tests.indexes.* `
This is an automated email from the ASF dual-hosted git repository.
dongjoon 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 9585cf6d56e3 [SPARK-46309][PS][TESTS] Remove unused code in `pyspark.pandas.tests.indexes.* `
9585cf6d56e3 is described below
commit 9585cf6d56e3af37142609668dda1eeda3ec876f
Author: Ruifeng Zheng <ru...@apache.org>
AuthorDate: Thu Dec 7 15:04:07 2023 -0800
[SPARK-46309][PS][TESTS] Remove unused code in `pyspark.pandas.tests.indexes.* `
### What changes were proposed in this pull request?
Remove unused code in `pyspark.pandas.tests.indexes.* `
### Why are the changes needed?
clean up the code
### Does this PR introduce _any_ user-facing change?
no
### How was this patch tested?
ci
### Was this patch authored or co-authored using generative AI tooling?
no
Closes #44239 from zhengruifeng/ps_index_cleanup.
Authored-by: Ruifeng Zheng <ru...@apache.org>
Signed-off-by: Dongjoon Hyun <dh...@apple.com>
---
.../pyspark/pandas/tests/data_type_ops/test_string_ops.py | 4 ----
python/pyspark/pandas/tests/indexes/test_align.py | 14 --------------
python/pyspark/pandas/tests/indexes/test_base_slow.py | 7 -------
python/pyspark/pandas/tests/indexes/test_reindex.py | 14 --------------
python/pyspark/pandas/tests/indexes/test_rename.py | 14 --------------
5 files changed, 53 deletions(-)
diff --git a/python/pyspark/pandas/tests/data_type_ops/test_string_ops.py b/python/pyspark/pandas/tests/data_type_ops/test_string_ops.py
index 2870aed8e75e..340153b06335 100644
--- a/python/pyspark/pandas/tests/data_type_ops/test_string_ops.py
+++ b/python/pyspark/pandas/tests/data_type_ops/test_string_ops.py
@@ -35,10 +35,6 @@ class StringOpsTestsMixin:
def bool_pdf(self):
return pd.DataFrame({"this": ["x", "y", "z"], "that": ["z", "y", "x"]})
- @property
- def bool_psdf(self):
- return ps.from_pandas(self.bool_pdf)
-
@property
def bool_non_numeric_pdf(self):
return pd.concat([self.bool_pdf, self.non_numeric_pdf], axis=1)
diff --git a/python/pyspark/pandas/tests/indexes/test_align.py b/python/pyspark/pandas/tests/indexes/test_align.py
index 56fde9b4f28b..73e10d441078 100644
--- a/python/pyspark/pandas/tests/indexes/test_align.py
+++ b/python/pyspark/pandas/tests/indexes/test_align.py
@@ -16,7 +16,6 @@
#
import unittest
-import numpy as np
import pandas as pd
from pyspark import pandas as ps
@@ -25,19 +24,6 @@ from pyspark.testing.sqlutils import SQLTestUtils
class FrameAlignMixin:
- @property
- def pdf(self):
- return pd.DataFrame(
- {"a": [1, 2, 3, 4, 5, 6, 7, 8, 9], "b": [4, 5, 6, 3, 2, 1, 0, 0, 0]},
- index=np.random.rand(9),
- )
-
- @property
- def df_pair(self):
- pdf = self.pdf
- psdf = ps.from_pandas(pdf)
- return pdf, psdf
-
def test_align(self):
pdf1 = pd.DataFrame({"a": [1, 2, 3], "b": ["a", "b", "c"]}, index=[10, 20, 30])
psdf1 = ps.from_pandas(pdf1)
diff --git a/python/pyspark/pandas/tests/indexes/test_base_slow.py b/python/pyspark/pandas/tests/indexes/test_base_slow.py
index c890f5004b43..eb417fe47ef8 100644
--- a/python/pyspark/pandas/tests/indexes/test_base_slow.py
+++ b/python/pyspark/pandas/tests/indexes/test_base_slow.py
@@ -24,13 +24,6 @@ from pyspark.testing.pandasutils import ComparisonTestBase, TestUtils
class IndexesSlowTestsMixin:
- @property
- def pdf(self):
- return pd.DataFrame(
- {"a": [1, 2, 3, 4, 5, 6, 7, 8, 9], "b": [4, 5, 6, 3, 2, 1, 0, 0, 0]},
- index=[0, 1, 3, 5, 6, 8, 9, 9, 9],
- )
-
def test_append(self):
# Index
pidx = pd.Index(range(10000))
diff --git a/python/pyspark/pandas/tests/indexes/test_reindex.py b/python/pyspark/pandas/tests/indexes/test_reindex.py
index 1d544ea221bf..1229a613846b 100644
--- a/python/pyspark/pandas/tests/indexes/test_reindex.py
+++ b/python/pyspark/pandas/tests/indexes/test_reindex.py
@@ -16,7 +16,6 @@
#
import unittest
-import numpy as np
import pandas as pd
from pyspark import pandas as ps
@@ -25,19 +24,6 @@ from pyspark.testing.sqlutils import SQLTestUtils
class FrameReindexMixin:
- @property
- def pdf(self):
- return pd.DataFrame(
- {"a": [1, 2, 3, 4, 5, 6, 7, 8, 9], "b": [4, 5, 6, 3, 2, 1, 0, 0, 0]},
- index=np.random.rand(9),
- )
-
- @property
- def df_pair(self):
- pdf = self.pdf
- psdf = ps.from_pandas(pdf)
- return pdf, psdf
-
def test_reindex(self):
index = pd.Index(["A", "B", "C", "D", "E"])
columns = pd.Index(["numbers"])
diff --git a/python/pyspark/pandas/tests/indexes/test_rename.py b/python/pyspark/pandas/tests/indexes/test_rename.py
index b59408952143..662071f420e9 100644
--- a/python/pyspark/pandas/tests/indexes/test_rename.py
+++ b/python/pyspark/pandas/tests/indexes/test_rename.py
@@ -16,7 +16,6 @@
#
import unittest
-import numpy as np
import pandas as pd
from pyspark import pandas as ps
@@ -25,19 +24,6 @@ from pyspark.testing.sqlutils import SQLTestUtils
class FrameRenameMixin:
- @property
- def pdf(self):
- return pd.DataFrame(
- {"a": [1, 2, 3, 4, 5, 6, 7, 8, 9], "b": [4, 5, 6, 3, 2, 1, 0, 0, 0]},
- index=np.random.rand(9),
- )
-
- @property
- def df_pair(self):
- pdf = self.pdf
- psdf = ps.from_pandas(pdf)
- return pdf, psdf
-
def test_rename_dataframe(self):
pdf1 = pd.DataFrame({"A": [1, 2, 3], "B": [4, 5, 6]})
psdf1 = ps.from_pandas(pdf1)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org