You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by gu...@apache.org on 2023/06/19 00:33:41 UTC

[spark] branch master updated: [MINOR][PYTHON][PS][TESTS] Rename `k_res` to `ps_res` (drop Koalas reference)

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

gurwls223 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 7dde27e387e [MINOR][PYTHON][PS][TESTS] Rename `k_res` to `ps_res` (drop Koalas reference)
7dde27e387e is described below

commit 7dde27e387eba1bd58cb83b9496c06b4ed2b1f52
Author: Deepyaman Datta <de...@utexas.edu>
AuthorDate: Mon Jun 19 09:33:31 2023 +0900

    [MINOR][PYTHON][PS][TESTS] Rename `k_res` to `ps_res` (drop Koalas reference)
    
    ### What changes were proposed in this pull request?
    
    Rename `k_res` to `ps_res` and `ps` to `pser` in `test_combine.py`. There is no functional change; it's purely stylistic/for consistency.
    
    ### Why are the changes needed?
    
    As a reader, the variable names are confusing and inconsistent. I only thought that the `k_` prefix meant Koalas because I've contributed to Koalas in the past.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No
    
    ### How was this patch tested?
    
    Existing tests should continue to pass; no new tests necessary
    
    Closes #41634 from deepyaman/patch-1.
    
    Authored-by: Deepyaman Datta <de...@utexas.edu>
    Signed-off-by: Hyukjin Kwon <gu...@apache.org>
---
 .../pandas/tests/computation/test_combine.py       | 28 ++++++++++++----------
 1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/python/pyspark/pandas/tests/computation/test_combine.py b/python/pyspark/pandas/tests/computation/test_combine.py
index 4c06b63b268..dd55c0fd686 100644
--- a/python/pyspark/pandas/tests/computation/test_combine.py
+++ b/python/pyspark/pandas/tests/computation/test_combine.py
@@ -148,21 +148,21 @@ class FrameCombineMixin:
             },
             columns=["rkey", "value", "y"],
         )
-        right_ps = pd.Series(list("defghi"), name="x", index=[5, 6, 7, 8, 9, 10])
+        right_pser = pd.Series(list("defghi"), name="x", index=[5, 6, 7, 8, 9, 10])
 
         left_psdf = ps.from_pandas(left_pdf)
         right_psdf = ps.from_pandas(right_pdf)
-        right_psser = ps.from_pandas(right_ps)
+        right_psser = ps.from_pandas(right_pser)
 
         def check(op, right_psdf=right_psdf, right_pdf=right_pdf):
-            k_res = op(left_psdf, right_psdf)
-            k_res = k_res._to_pandas()
-            k_res = k_res.sort_values(by=list(k_res.columns))
-            k_res = k_res.reset_index(drop=True)
+            ps_res = op(left_psdf, right_psdf)
+            ps_res = ps_res._to_pandas()
+            ps_res = ps_res.sort_values(by=list(ps_res.columns))
+            ps_res = ps_res.reset_index(drop=True)
             p_res = op(left_pdf, right_pdf)
             p_res = p_res.sort_values(by=list(p_res.columns))
             p_res = p_res.reset_index(drop=True)
-            self.assert_eq(k_res, p_res)
+            self.assert_eq(ps_res, p_res)
 
         check(lambda left, right: left.merge(right))
         check(lambda left, right: left.merge(right, on="value"))
@@ -218,23 +218,25 @@ class FrameCombineMixin:
         )
 
         # Test Series on the right
-        check(lambda left, right: left.merge(right), right_psser, right_ps)
+        check(lambda left, right: left.merge(right), right_psser, right_pser)
         check(
-            lambda left, right: left.merge(right, left_on="x", right_on="x"), right_psser, right_ps
+            lambda left, right: left.merge(right, left_on="x", right_on="x"),
+            right_psser,
+            right_pser,
         )
         check(
             lambda left, right: left.set_index("x").merge(right, left_index=True, right_on="x"),
             right_psser,
-            right_ps,
+            right_pser,
         )
 
         # Test join types with Series
         for how in ["inner", "left", "right", "outer"]:
-            check(lambda left, right: left.merge(right, how=how), right_psser, right_ps)
+            check(lambda left, right: left.merge(right, how=how), right_psser, right_pser)
             check(
                 lambda left, right: left.merge(right, left_on="x", right_on="x", how=how),
                 right_psser,
-                right_ps,
+                right_pser,
             )
 
         # suffix with Series
@@ -247,7 +249,7 @@ class FrameCombineMixin:
                 right_index=True,
             ),
             right_psser,
-            right_ps,
+            right_pser,
         )
 
         # multi-index columns


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