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/05/28 10:38:11 UTC

[GitHub] [spark] Yikun opened a new pull request, #36712: [SPARK-38819][PS] replace "NaN" with real "None" value in indexes

Yikun opened a new pull request, #36712:
URL: https://github.com/apache/spark/pull/36712

   ### What changes were proposed in this pull request?
   
   Since pandas 1.4 https://github.com/pandas-dev/pandas/commit/aaba0efd630ed607c5aaaef7b5f43d2fe90ca81c
   
   > Series.__repr__() and DataFrame.__repr__() no longer replace all null-values in indexes with “NaN” but use their real string-representations. “NaN” is used only for float("nan")
   
   We need to fix the doctest in PS
   
   
   ### Why are the changes needed?
   follow pandas behavior
   
   ### Does this PR introduce _any_ user-facing change?
   Yes, follow pandas behavior
   
   ### How was this patch tested?
   CI passed
   


-- 
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] Yikun commented on a diff in pull request #36712: [SPARK-39326][PYTHON][PS] replace "NaN" with real "None" value in indexes

Posted by GitBox <gi...@apache.org>.
Yikun commented on code in PR #36712:
URL: https://github.com/apache/spark/pull/36712#discussion_r884381846


##########
python/pyspark/pandas/frame.py:
##########
@@ -551,11 +551,11 @@ def ndim(self) -> int:
         >>> df = ps.DataFrame([[1, 2], [4, 5], [7, 8]],
         ...                   index=['cobra', 'viper', None],
         ...                   columns=['max_speed', 'shield'])
-        >>> df
+        >>> df  # doctest: +SKIP

Review Comment:
   BTW, here is the final test with pandas 1.4. all changes have been submited as PRs
   
   [1] https://github.com/Yikun/spark/pull/102



-- 
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] Yikun commented on a diff in pull request #36712: [SPARK-39326][PYTHON][PS] replace "NaN" with real "None" value in indexes

Posted by GitBox <gi...@apache.org>.
Yikun commented on code in PR #36712:
URL: https://github.com/apache/spark/pull/36712#discussion_r884381079


##########
python/pyspark/pandas/frame.py:
##########
@@ -551,11 +551,11 @@ def ndim(self) -> int:
         >>> df = ps.DataFrame([[1, 2], [4, 5], [7, 8]],
         ...                   index=['cobra', 'viper', None],
         ...                   columns=['max_speed', 'shield'])
-        >>> df
+        >>> df  # doctest: +SKIP

Review Comment:
   The fix will be failed with panda 1.3.x (it's [current version of ci infra](https://github.com/dongjoon-hyun/ApacheSparkGitHubActionImage/blob/ac09d7a4431b209caa86090c54bfccd4d744d0ce/Dockerfile#L32)), as I mentioned in [previous comment](https://github.com/apache/spark/pull/36712#issuecomment-1140234328) , we will cleanup `# doctest: +SKIP` after we upgrade pandas to 1.4.



-- 
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 #36712: [SPARK-39326][PYTHON][PS] replace "NaN" with real "None" value in indexes

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

   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] Yikun commented on pull request #36712: [SPARK-39326][PYTHON][PS] replace "NaN" with real "None" value in indexes

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

   also cc @HyukjinKwon @xinrong-databricks ready for review


-- 
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] Yikun commented on a diff in pull request #36712: [SPARK-39326][PYTHON][PS] replace "NaN" with real "None" value in indexes

Posted by GitBox <gi...@apache.org>.
Yikun commented on code in PR #36712:
URL: https://github.com/apache/spark/pull/36712#discussion_r884381846


##########
python/pyspark/pandas/frame.py:
##########
@@ -551,11 +551,11 @@ def ndim(self) -> int:
         >>> df = ps.DataFrame([[1, 2], [4, 5], [7, 8]],
         ...                   index=['cobra', 'viper', None],
         ...                   columns=['max_speed', 'shield'])
-        >>> df
+        >>> df  # doctest: +SKIP

Review Comment:
   BTW, here is the final test with pandas 1.4 (all ut/doctest passed). all changes have been submited as PRs
   
   [1] https://github.com/Yikun/spark/pull/102



-- 
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 #36712: [SPARK-39326][PYTHON][PS] replace "NaN" with real "None" value in indexes

Posted by GitBox <gi...@apache.org>.
HyukjinKwon closed pull request #36712: [SPARK-39326][PYTHON][PS] replace "NaN" with real  "None" value in indexes
URL: https://github.com/apache/spark/pull/36712


-- 
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] itholic commented on a diff in pull request #36712: [SPARK-39326][PYTHON][PS] replace "NaN" with real "None" value in indexes

Posted by GitBox <gi...@apache.org>.
itholic commented on code in PR #36712:
URL: https://github.com/apache/spark/pull/36712#discussion_r884372010


##########
python/pyspark/pandas/frame.py:
##########
@@ -551,11 +551,11 @@ def ndim(self) -> int:
         >>> df = ps.DataFrame([[1, 2], [4, 5], [7, 8]],
         ...                   index=['cobra', 'viper', None],
         ...                   columns=['max_speed', 'shield'])
-        >>> df
+        >>> df  # doctest: +SKIP

Review Comment:
   qq: Why do we need to skip this?



-- 
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] Yikun commented on a diff in pull request #36712: [SPARK-39326][PYTHON][PS] replace "NaN" with real "None" value in indexes

Posted by GitBox <gi...@apache.org>.
Yikun commented on code in PR #36712:
URL: https://github.com/apache/spark/pull/36712#discussion_r884381079


##########
python/pyspark/pandas/frame.py:
##########
@@ -551,11 +551,11 @@ def ndim(self) -> int:
         >>> df = ps.DataFrame([[1, 2], [4, 5], [7, 8]],
         ...                   index=['cobra', 'viper', None],
         ...                   columns=['max_speed', 'shield'])
-        >>> df
+        >>> df  # doctest: +SKIP

Review Comment:
   The fix will be failed with panda 1.3.x (it's [current version of ci infra](https://github.com/dongjoon-hyun/ApacheSparkGitHubActionImage/blob/ac09d7a4431b209caa86090c54bfccd4d744d0ce/Dockerfile#L32)), as I mentioned in [previous comment](https://github.com/apache/spark/pull/36712#issuecomment-1140234328) (misleading before, I updated) , we will cleanup `# doctest: +SKIP` after we upgrade pandas to 1.4.



-- 
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] Yikun commented on pull request #36712: [SPARK-39326][PYTHON][PS] replace "NaN" with real "None" value in indexes

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

   We need to cleanup all these doctest after bump pandas to 1.4. will address together in SPARK-39150.


-- 
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] itholic commented on a diff in pull request #36712: [SPARK-39326][PYTHON][PS] replace "NaN" with real "None" value in indexes

Posted by GitBox <gi...@apache.org>.
itholic commented on code in PR #36712:
URL: https://github.com/apache/spark/pull/36712#discussion_r884372067


##########
python/pyspark/pandas/frame.py:
##########
@@ -7226,36 +7226,36 @@ def sort_index(
         --------
         >>> df = ps.DataFrame({'A': [2, 1, np.nan]}, index=['b', 'a', np.nan])
 
-        >>> df.sort_index()
-               A
-        a    1.0
-        b    2.0
-        NaN  NaN
-
-        >>> df.sort_index(ascending=False)
-               A
-        b    2.0
-        a    1.0
-        NaN  NaN
-
-        >>> df.sort_index(na_position='first')
-               A
-        NaN  NaN
-        a    1.0
-        b    2.0
+        >>> df.sort_index()  # doctest: +SKIP
+                A
+        a     1.0
+        b     2.0
+        None  NaN
+
+        >>> df.sort_index(ascending=False)  # doctest: +SKIP
+                A
+        b     2.0
+        a     1.0
+        None  NaN
+
+        >>> df.sort_index(na_position='first')  # doctest: +SKIP
+                A
+        None  NaN
+        a     1.0
+        b     2.0

Review Comment:
   ditto?



-- 
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] Yikun commented on a diff in pull request #36712: [SPARK-39326][PYTHON][PS] replace "NaN" with real "None" value in indexes

Posted by GitBox <gi...@apache.org>.
Yikun commented on code in PR #36712:
URL: https://github.com/apache/spark/pull/36712#discussion_r884381079


##########
python/pyspark/pandas/frame.py:
##########
@@ -551,11 +551,11 @@ def ndim(self) -> int:
         >>> df = ps.DataFrame([[1, 2], [4, 5], [7, 8]],
         ...                   index=['cobra', 'viper', None],
         ...                   columns=['max_speed', 'shield'])
-        >>> df
+        >>> df  # doctest: +SKIP

Review Comment:
   The fix will be failed with panda 1.3.x ([the current version of ci infra](https://github.com/dongjoon-hyun/ApacheSparkGitHubActionImage/blob/ac09d7a4431b209caa86090c54bfccd4d744d0ce/Dockerfile#L32)), as I mentioned in [previous comment](https://github.com/apache/spark/pull/36712#issuecomment-1140234328) (misleading before, I updated) , we will cleanup `# doctest: +SKIP` after we upgrade pandas to 1.4.



-- 
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