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 2021/12/02 06:03:25 UTC

[GitHub] [spark] dchvn opened a new pull request #34778: [SPARK-36396][PYTHON][FOLLOWUP] Fix test with extensions dtype when pandas version < 1.2

dchvn opened a new pull request #34778:
URL: https://github.com/apache/spark/pull/34778


   ### What changes were proposed in this pull request?
   Fix test of `pd.Dataframe.cov` with extensions dtype when pandas version < 1.2
   
   ### Why are the changes needed?
   Pass test of `pd.Dataframe.cov` with pandas version < 1.2
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   ### How was this patch tested?
   Existing tests
   


-- 
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 #34778: [SPARK-36396][PYTHON][FOLLOWUP] Fix test with extensions dtype when pandas version < 1.2

Posted by GitBox <gi...@apache.org>.
HyukjinKwon closed pull request #34778:
URL: https://github.com/apache/spark/pull/34778


   


-- 
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 #34778: [SPARK-36396][PYTHON][FOLLOWUP] Fix test with extensions dtype when pandas version < 1.2

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


   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] HyukjinKwon commented on a change in pull request #34778: [SPARK-36396][PYTHON][FOLLOWUP] Fix test with extensions dtype when pandas version < 1.2

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on a change in pull request #34778:
URL: https://github.com/apache/spark/pull/34778#discussion_r760789523



##########
File path: python/pyspark/pandas/tests/test_dataframe.py
##########
@@ -5870,8 +5870,12 @@ def test_cov(self):
         self.assert_eq(pdf.cov(min_periods=5), psdf.cov(min_periods=5))
 
         # extension dtype
-        numeric_dtypes = ["Int8", "Int16", "Int32", "Int64", "Float32", "Float64", "float"]
-        boolean_dtypes = ["boolean", "bool"]
+        if LooseVersion(pd.__version__) >= LooseVersion("1.2"):

Review comment:
       @dchvn just to clarify, so cov API only works correctly with pandas 1.2+? or are you just fixing the tests only?




-- 
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] dchvn commented on a change in pull request #34778: [SPARK-36396][PYTHON][FOLLOWUP] Fix test with extensions dtype when pandas version < 1.2

Posted by GitBox <gi...@apache.org>.
dchvn commented on a change in pull request #34778:
URL: https://github.com/apache/spark/pull/34778#discussion_r760795723



##########
File path: python/pyspark/pandas/tests/test_dataframe.py
##########
@@ -5870,8 +5870,12 @@ def test_cov(self):
         self.assert_eq(pdf.cov(min_periods=5), psdf.cov(min_periods=5))
 
         # extension dtype
-        numeric_dtypes = ["Int8", "Int16", "Int32", "Int64", "Float32", "Float64", "float"]
-        boolean_dtypes = ["boolean", "bool"]
+        if LooseVersion(pd.__version__) >= LooseVersion("1.2"):

Review comment:
       with pandas < 1.2, `pd.Dataframe.cov` can not work with extension dtype `NAType`, so I just fix the test only
   ```python
   >>> pd.__version__
   '1.0.5'
   >>> pdf = pd.DataFrame([[1,2],[None, 3]], dtype="Int64")
   >>> pdf
         0  1
   0     1  2
   1  <NA>  3
   >>> pdf.cov()
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
     File "/u02/venv/python3.8/lib/python3.8/site-packages/pandas/core/frame.py", line 7608, in cov
       baseCov = libalgos.nancorr(ensure_float64(mat), cov=True, minp=min_periods)
     File "pandas/_libs/algos_common_helper.pxi", line 41, in pandas._libs.algos.ensure_float64
   TypeError: float() argument must be a string or a number, not 'NAType'
   ```




-- 
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] SparkQA commented on pull request #34778: [SPARK-36396][PYTHON][FOLLOWUP] Fix test with extensions dtype when pandas version < 1.2

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34778:
URL: https://github.com/apache/spark/pull/34778#issuecomment-984332719


   **[Test build #145846 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/145846/testReport)** for PR 34778 at commit [`73a84fc`](https://github.com/apache/spark/commit/73a84fccdcfcc84cf68e8a73ee830dd0c4522627).


-- 
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] SparkQA commented on pull request #34778: [SPARK-36396][PYTHON][FOLLOWUP] Fix test with extensions dtype when pandas version < 1.2

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34778:
URL: https://github.com/apache/spark/pull/34778#issuecomment-984353579


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/50321/
   


-- 
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] AmplabJenkins commented on pull request #34778: [SPARK-36396][PYTHON][FOLLOWUP] Fix test with extensions dtype when pandas version < 1.2

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #34778:
URL: https://github.com/apache/spark/pull/34778#issuecomment-984360340


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/145846/
   


-- 
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] AmplabJenkins removed a comment on pull request #34778: [SPARK-36396][PYTHON][FOLLOWUP] Fix test with extensions dtype when pandas version < 1.2

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #34778:
URL: https://github.com/apache/spark/pull/34778#issuecomment-984360340


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/145846/
   


-- 
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] AmplabJenkins removed a comment on pull request #34778: [SPARK-36396][PYTHON][FOLLOWUP] Fix test with extensions dtype when pandas version < 1.2

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #34778:
URL: https://github.com/apache/spark/pull/34778#issuecomment-984397512


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/50321/
   


-- 
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] AmplabJenkins commented on pull request #34778: [SPARK-36396][PYTHON][FOLLOWUP] Fix test with extensions dtype when pandas version < 1.2

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #34778:
URL: https://github.com/apache/spark/pull/34778#issuecomment-984397512


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/50321/
   


-- 
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] SparkQA removed a comment on pull request #34778: [SPARK-36396][PYTHON][FOLLOWUP] Fix test with extensions dtype when pandas version < 1.2

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #34778:
URL: https://github.com/apache/spark/pull/34778#issuecomment-984332719


   **[Test build #145846 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/145846/testReport)** for PR 34778 at commit [`73a84fc`](https://github.com/apache/spark/commit/73a84fccdcfcc84cf68e8a73ee830dd0c4522627).


-- 
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] SparkQA commented on pull request #34778: [SPARK-36396][PYTHON][FOLLOWUP] Fix test with extensions dtype when pandas version < 1.2

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34778:
URL: https://github.com/apache/spark/pull/34778#issuecomment-984378415


   Kubernetes integration test status failure
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/50321/
   


-- 
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] SparkQA commented on pull request #34778: [SPARK-36396][PYTHON][FOLLOWUP] Fix test with extensions dtype when pandas version < 1.2

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34778:
URL: https://github.com/apache/spark/pull/34778#issuecomment-984345256


   **[Test build #145846 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/145846/testReport)** for PR 34778 at commit [`73a84fc`](https://github.com/apache/spark/commit/73a84fccdcfcc84cf68e8a73ee830dd0c4522627).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.


-- 
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 #34778: [SPARK-36396][PYTHON][FOLLOWUP] Fix test with extensions dtype when pandas version < 1.2

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


   Thanks @dchvn !


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