You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/04/19 22:44:28 UTC

[GitHub] [spark] xinrong-databricks opened a new pull request, #36269: Test anchor frame for in-place `Series.rename_axis`

xinrong-databricks opened a new pull request, #36269:
URL: https://github.com/apache/spark/pull/36269

   ### What changes were proposed in this pull request?
   Test anchor frame for in-place `Series.rename_axis`.
   
   ### Why are the changes needed?
   As a follow-up for https://github.com/apache/spark/pull/36250, we should ensure the in-place `rename_axis` on Series doesn't change its anchor frame.
   
   ### Does this PR introduce _any_ user-facing change?
   No. Test only.
   
   
   ### How was this patch tested?
   Unit test.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [spark] xinrong-databricks commented on pull request #36269: [SPARK-38971][PYTHON] Test anchor frame for in-place `Series.rename_axis`

Posted by GitBox <gi...@apache.org>.
xinrong-databricks commented on PR #36269:
URL: https://github.com/apache/spark/pull/36269#issuecomment-1104227488

   @ueshin @HyukjinKwon @itholic Thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [spark] HyukjinKwon commented on pull request #36269: [SPARK-38971][PYTHON] Test anchor frame for in-place `Series.rename_axis`

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on PR #36269:
URL: https://github.com/apache/spark/pull/36269#issuecomment-1104575077

   Merged to master.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [spark] xinrong-databricks commented on a diff in pull request #36269: Test anchor frame for in-place `Series.rename_axis`

Posted by GitBox <gi...@apache.org>.
xinrong-databricks commented on code in PR #36269:
URL: https://github.com/apache/spark/pull/36269#discussion_r853557693


##########
python/pyspark/pandas/tests/test_series.py:
##########
@@ -260,6 +255,12 @@ def test_rename_axis(self):
             psser.rename_axis(index=str.upper).sort_index(),
         )
 
+        pser.rename_axis("index2", inplace=True)
+        psser.rename_axis("index2", inplace=True)
+        self.assert_eq(pser.sort_index(), psser.sort_index())
+        # Note: in pandas, pdf.x's index is renamed, whereas pdf's index isn't due to a bug.

Review Comment:
   https://github.com/pandas-dev/pandas/issues/46807



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [spark] xinrong-databricks commented on a diff in pull request #36269: Test anchor frame for in-place `Series.rename_axis`

Posted by GitBox <gi...@apache.org>.
xinrong-databricks commented on code in PR #36269:
URL: https://github.com/apache/spark/pull/36269#discussion_r853557693


##########
python/pyspark/pandas/tests/test_series.py:
##########
@@ -260,6 +255,12 @@ def test_rename_axis(self):
             psser.rename_axis(index=str.upper).sort_index(),
         )
 
+        pser.rename_axis("index2", inplace=True)
+        psser.rename_axis("index2", inplace=True)
+        self.assert_eq(pser.sort_index(), psser.sort_index())
+        # Note: in pandas, pdf.x's index is renamed, whereas pdf's index isn't due to a bug.

Review Comment:
   The code block has to be tested last since in-place `rename_axis` on `pdf` changes `pdf.x` accidentally.
   See https://github.com/pandas-dev/pandas/issues/46807.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [spark] HyukjinKwon closed pull request #36269: [SPARK-38971][PYTHON][TESTS] Test anchor frame for in-place `Series.rename_axis`

Posted by GitBox <gi...@apache.org>.
HyukjinKwon closed pull request #36269: [SPARK-38971][PYTHON][TESTS] Test anchor frame for in-place `Series.rename_axis`
URL: https://github.com/apache/spark/pull/36269


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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