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/06/04 18:29:08 UTC

[GitHub] [spark] xinrong-databricks opened a new pull request #32785: [WIP][SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://spark.apache.org/contributing.html
     2. Ensure you have added or run the appropriate tests for your PR: https://spark.apache.org/developer-tools.html
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][SPARK-XXXX] Your PR title ...'.
     4. Be sure to keep the PR description updated to reflect all changes.
     5. Please write your PR title to summarize what this PR proposes.
     6. If possible, provide a concise example to reproduce the issue for a faster review.
     7. If you want to add a new configuration, please read the guideline first for naming configurations in
        'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
     8. If you want to add or modify an error message, please read the guideline first:
        https://spark.apache.org/error-message-guidelines.html
   -->
   
   ### What changes were proposed in this pull request?
   <!--
   Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue. 
   If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
     1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
     2. If you fix some SQL features, you can provide some references of other DBMSes.
     3. If there is design documentation, please add the link.
     4. If there is a discussion in the mailing list, please add the link.
   -->
   Support arithmetic operations against bool literals
   
   ### Why are the changes needed?
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you propose a new API, clarify the use case for a new API.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   Arithmetic operations involving bool literals are not supported now. A TypeError would be raised when `psser + True` for example.
   We ought to match pandas' behaviors.
   
   ### Does this PR introduce _any_ user-facing change?
   <!--
   Note that it means *any* user-facing change including all aspects such as the documentation fix.
   If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
   If possible, please also clarify if this is a user-facing change compared to the released Spark versions or within the unreleased branches such as master.
   If no, write 'No'.
   -->
   Yes.
   
   ### How was this patch tested?
   <!--
   If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
   If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why it was difficult to add.
   -->
   Unit 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.

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


   **[Test build #139353 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139353/testReport)** for PR 32785 at commit [`f90000b`](https://github.com/apache/spark/commit/f90000b14c693c808f4d73558888fef37f615d9c).
    * 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.

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


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


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

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


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


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

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 change in pull request #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

Posted by GitBox <gi...@apache.org>.
xinrong-databricks commented on a change in pull request #32785:
URL: https://github.com/apache/spark/pull/32785#discussion_r647626216



##########
File path: python/pyspark/pandas/data_type_ops/base.py
##########
@@ -52,33 +52,42 @@
     from pyspark.pandas.series import Series  # noqa: F401 (SPARK-34943)
 
 
-def is_valid_operand_for_numeric_arithmetic(operand: Any, *, allow_bool: bool = True) -> bool:
-    """Check whether the operand is valid for arithmetic operations against numerics."""
+def is_valid_operand_for_numeric_arithmetic(
+    operand: Any, *, allow_bool_index_ops: bool = True, allow_bool: bool = True

Review comment:
       Good question. There is NOT a case where only bool index should be allowed alone, but there is a case `allow_bool_index_ops` is `False`, whereas `allow_bool` is `True`, for example
   ```py
   >>> ps.Series([True, False, True]) + ps.Series([True, False, True])
   Traceback (most recent call last):
   ...
   TypeError: Addition can not be applied to booleans and the given type.
   
   >>> ps.Series([True, False, True]) + True
   0    True
   1    True
   2    True
   dtype: bool
   ```
   
   In case you are interested, there is a case `allow_bool_index_ops` and `allow_bool` are both `True`, for example
   ```py
   >>> ps.Series([1, 2, 3]) + ps.Series([True, False, True])
   0    2
   1    2
   2    4
   dtype: int64
   >>> ps.Series([1, 2, 3]) + True
   0    2
   1    3
   2    4
   dtype: int64
   ```
   
   And there is a case `allow_bool_index_ops` and `allow_bool` are both `False`, for example
   ```py
   >> ps.Series([True, False, True]) - ps.Series([True, False, True])
   Traceback (most recent call last):
   ...
   TypeError: Subtraction can not be applied to booleans and the given type.
   >>> ps.Series([True, False, True]) - True
   Traceback (most recent call last):
   ...
   TypeError: Subtraction can not be applied to booleans and the given type.
   
   ```
   
   That's why `allow_bool_index_ops` might be needed. Does that make sense?




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

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


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


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

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


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


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

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 #32785: [SPARK-35601][PYTHON] Complete arithmetic operators involving bool literals, Series, and Index

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


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


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

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


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


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

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


   **[Test build #139507 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139507/testReport)** for PR 32785 at commit [`afe4044`](https://github.com/apache/spark/commit/afe40446a4df45767629fa7ea7612db56a6ec056).


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

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


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


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

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 #32785: [WIP][SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


   **[Test build #139348 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139348/testReport)** for PR 32785 at commit [`3756dc3`](https://github.com/apache/spark/commit/3756dc3febc2c161eeff54eb9364be1e9511751f).
    * 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.

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 #32785: [SPARK-35601][PYTHON] Complete arithmetic operators involving bool literals, Series, and Index

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


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


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

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 #32785: [SPARK-35601][PYTHON] Complete arithmetic operators involving bool literals, Series, and Index

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


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


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

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] ueshin commented on a change in pull request #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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



##########
File path: python/pyspark/pandas/data_type_ops/base.py
##########
@@ -52,33 +52,42 @@
     from pyspark.pandas.series import Series  # noqa: F401 (SPARK-34943)
 
 
-def is_valid_operand_for_numeric_arithmetic(operand: Any, *, allow_bool: bool = True) -> bool:
-    """Check whether the operand is valid for arithmetic operations against numerics."""
+def is_valid_operand_for_numeric_arithmetic(
+    operand: Any, *, allow_bool_index_ops: bool = True, allow_bool: bool = True

Review comment:
       For the first example, pandas works for both cases:
   
   ```py
   >>> pd.__version__
   '1.2.4'
   
   >>> pd.Series([True, False, True]) + pd.Series([True, False, True])
   0     True
   1    False
   2     True
   dtype: bool
   
   >>> pd.Series([True, False, True]) + True
   0    True
   1    True
   2    True
   dtype: bool
   ```
   
   so `allow_bool_index_ops` and `allow_bool` should be `True` for this case as well. Then we can consolidate the two?




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

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 #32785: [SPARK-35601][PYTHON] Complete arithmetic operators involving bool literals, Series, and Index

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


   **[Test build #139593 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139593/testReport)** for PR 32785 at commit [`0489747`](https://github.com/apache/spark/commit/048974727b69fcb1b845c91fdf65c91775b338f4).


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

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 #32785: [SPARK-35601][PYTHON] Complete arithmetic operators involving bool literals, Series, and Index

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


   **[Test build #139586 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139586/testReport)** for PR 32785 at commit [`1f9f0e4`](https://github.com/apache/spark/commit/1f9f0e434a45ba953b1be593352089edd2f753db).


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

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 #32785: [WIP][SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


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


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

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 #32785: [SPARK-35601][PYTHON] Complete arithmetic operators involving bool literals, Series, and Index

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


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


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

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


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


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

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 #32785: [WIP][SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


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


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

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 #32785: [SPARK-35601][PYTHON] Complete arithmetic operators involving bool literals, Series, and Index

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


   **[Test build #139593 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139593/testReport)** for PR 32785 at commit [`0489747`](https://github.com/apache/spark/commit/048974727b69fcb1b845c91fdf65c91775b338f4).
    * 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.

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 #32785: [SPARK-35601][PYTHON] Complete arithmetic operators involving bool literals, Series, and Index

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


   **[Test build #139521 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139521/testReport)** for PR 32785 at commit [`5c0f559`](https://github.com/apache/spark/commit/5c0f55911dc81176ecdc4a8dd8278a6818f00754).


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

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


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


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

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 #32785: [SPARK-35601][PYTHON] Complete arithmetic operators involving bool literals, Series, and Index

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


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


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

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] ueshin commented on a change in pull request #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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



##########
File path: python/pyspark/pandas/data_type_ops/boolean_ops.py
##########
@@ -73,7 +77,9 @@ def sub(self, left, right) -> Union["Series", "Index"]:
             return left - right
 
     def mul(self, left, right) -> Union["Series", "Index"]:
-        if not is_valid_operand_for_numeric_arithmetic(right, allow_bool=False):
+        if not is_valid_operand_for_numeric_arithmetic(
+            right, allow_bool_index_ops=False, allow_bool=False

Review comment:
       This should allow bools and behave like `&`?
   
   ```py
   >>> pd.Series([True, False, True]) * pd.Series([True, False, False])
   0     True
   1    False
   2    False
   dtype: bool
   >>> pd.Series([True, False, True]) * True
   0     True
   1    False
   2     True
   dtype: bool
   >>> pd.Series([True, False, True]) * False
   0    False
   1    False
   2    False
   dtype: bool
   ```




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

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


   ```
   ERROR [2.315s]: test_termination_sigterm (pyspark.tests.test_daemon.DaemonTests)
   Ensure that daemon and workers terminate on SIGTERM.
   ----------------------------------------------------------------------
   Traceback (most recent call last):
   ...
   AssertionError: Expected EnvironmentError to be raised
   ```
   Might not be related to the PR. Tests are retriggered.


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

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 change in pull request #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

Posted by GitBox <gi...@apache.org>.
xinrong-databricks commented on a change in pull request #32785:
URL: https://github.com/apache/spark/pull/32785#discussion_r647616907



##########
File path: python/pyspark/pandas/data_type_ops/base.py
##########
@@ -52,33 +52,42 @@
     from pyspark.pandas.series import Series  # noqa: F401 (SPARK-34943)
 
 
-def is_valid_operand_for_numeric_arithmetic(operand: Any, *, allow_bool: bool = True) -> bool:
-    """Check whether the operand is valid for arithmetic operations against numerics."""
+def is_valid_operand_for_numeric_arithmetic(
+    operand: Any, *, allow_bool_index_ops: bool = True, allow_bool: bool = True

Review comment:
       Good question. There is not a case where only bool index should be allowed alone, but here is a case `allow_bool_index_ops` is `False`, whereas `allow_bool` is `True`, for example
   ```py
   >>> ps.Series([True, False, True]) + ps.Series([True, False, True])
   Traceback (most recent call last):
   ...
   TypeError: Addition can not be applied to booleans and the given type.
   
   >>> ps.Series([True, False, True]) + True
   0    True
   1    True
   2    True
   dtype: bool
   ```
   
   In case you are interested, there is a case `allow_bool_index_ops` and `allow_bool` are both `True`, for example
   ```py
   >>> ps.Series([1, 2, 3]) + ps.Series([True, False, True])
   0    2
   1    2
   2    4
   dtype: int64
   >>> ps.Series([1, 2, 3]) + True
   0    2
   1    3
   2    4
   dtype: int64
   ```
   
   And there is a case `allow_bool_index_ops` and `allow_bool` are both `False`, for example
   ```py
   >> ps.Series([True, False, True]) - ps.Series([True, False, True])
   Traceback (most recent call last):
   ...
   TypeError: Subtraction can not be applied to booleans and the given type.
   >>> ps.Series([True, False, True]) - True
   Traceback (most recent call last):
   ...
   TypeError: Subtraction can not be applied to booleans and the given type.
   
   ```
   
   That's why `allow_bool_index_ops` might be needed. Does that make sense?




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

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 #32785: [SPARK-35601][PYTHON] Complete arithmetic operators involving bool literals, Series, and Index

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


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


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

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


   **[Test build #139438 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139438/testReport)** for PR 32785 at commit [`2ac8593`](https://github.com/apache/spark/commit/2ac8593809da6dd6936a69c0ae4eca96f419e5bc).


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

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


   **[Test build #139438 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139438/testReport)** for PR 32785 at commit [`2ac8593`](https://github.com/apache/spark/commit/2ac8593809da6dd6936a69c0ae4eca96f419e5bc).


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

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 #32785: [WIP][SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


   **[Test build #139353 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139353/testReport)** for PR 32785 at commit [`f90000b`](https://github.com/apache/spark/commit/f90000b14c693c808f4d73558888fef37f615d9c).


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

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


   **[Test build #139428 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139428/testReport)** for PR 32785 at commit [`ee39236`](https://github.com/apache/spark/commit/ee39236f19406ff8275e33f9f933be95c9048ce6).


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

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] ueshin commented on pull request #32785: [SPARK-35601][PYTHON] Complete arithmetic operators involving bool literals, Series, and Index

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


   Thanks! merging 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.

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 #32785: [WIP][SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


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


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

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 #32785: [WIP][SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


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


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

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 change in pull request #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

Posted by GitBox <gi...@apache.org>.
xinrong-databricks commented on a change in pull request #32785:
URL: https://github.com/apache/spark/pull/32785#discussion_r647907524



##########
File path: python/pyspark/pandas/data_type_ops/boolean_ops.py
##########
@@ -73,7 +77,9 @@ def sub(self, left, right) -> Union["Series", "Index"]:
             return left - right
 
     def mul(self, left, right) -> Union["Series", "Index"]:
-        if not is_valid_operand_for_numeric_arithmetic(right, allow_bool=False):
+        if not is_valid_operand_for_numeric_arithmetic(
+            right, allow_bool_index_ops=False, allow_bool=False

Review comment:
       +/* between bool Series/Index are supported now.




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

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


   **[Test build #139428 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139428/testReport)** for PR 32785 at commit [`ee39236`](https://github.com/apache/spark/commit/ee39236f19406ff8275e33f9f933be95c9048ce6).
    * This patch **fails PySpark unit 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.

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


   **[Test build #139507 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139507/testReport)** for PR 32785 at commit [`afe4044`](https://github.com/apache/spark/commit/afe40446a4df45767629fa7ea7612db56a6ec056).
    * 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.

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 change in pull request #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

Posted by GitBox <gi...@apache.org>.
xinrong-databricks commented on a change in pull request #32785:
URL: https://github.com/apache/spark/pull/32785#discussion_r647793085



##########
File path: python/pyspark/pandas/data_type_ops/base.py
##########
@@ -52,33 +52,42 @@
     from pyspark.pandas.series import Series  # noqa: F401 (SPARK-34943)
 
 
-def is_valid_operand_for_numeric_arithmetic(operand: Any, *, allow_bool: bool = True) -> bool:
-    """Check whether the operand is valid for arithmetic operations against numerics."""
+def is_valid_operand_for_numeric_arithmetic(
+    operand: Any, *, allow_bool_index_ops: bool = True, allow_bool: bool = True

Review comment:
       Makes sense! https://issues.apache.org/jira/browse/SPARK-35681 is created for supporting arithmetic operators (+, *) among bool Series/Index, the parameters will be consolidated at that time.




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

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 #32785: [SPARK-35601][PYTHON] Complete arithmetic operators involving bool literals, Series, and Index

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


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


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

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 #32785: [SPARK-35601][PYTHON] Complete arithmetic operators involving bool literals, Series, and Index

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


   **[Test build #139586 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139586/testReport)** for PR 32785 at commit [`1f9f0e4`](https://github.com/apache/spark/commit/1f9f0e434a45ba953b1be593352089edd2f753db).


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

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 change in pull request #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

Posted by GitBox <gi...@apache.org>.
xinrong-databricks commented on a change in pull request #32785:
URL: https://github.com/apache/spark/pull/32785#discussion_r647616907



##########
File path: python/pyspark/pandas/data_type_ops/base.py
##########
@@ -52,33 +52,42 @@
     from pyspark.pandas.series import Series  # noqa: F401 (SPARK-34943)
 
 
-def is_valid_operand_for_numeric_arithmetic(operand: Any, *, allow_bool: bool = True) -> bool:
-    """Check whether the operand is valid for arithmetic operations against numerics."""
+def is_valid_operand_for_numeric_arithmetic(
+    operand: Any, *, allow_bool_index_ops: bool = True, allow_bool: bool = True

Review comment:
       Good question. There is NOT a case where only bool index should be allowed alone, but there is a case `allow_bool_index_ops` is `False`, whereas `allow_bool` is `True`, for example
   ```py
   >>> ps.Series([True, False, True]) + ps.Series([True, False, True])
   Traceback (most recent call last):
   ...
   TypeError: Addition can not be applied to booleans and the given type.
   
   >>> ps.Series([True, False, True]) + True
   0    True
   1    True
   2    True
   dtype: bool
   ```
   
   In case you are interested, there is a case `allow_bool_index_ops` and `allow_bool` are both `True`, for example
   ```py
   >>> ps.Series([1, 2, 3]) + ps.Series([True, False, True])
   0    2
   1    2
   2    4
   dtype: int64
   >>> ps.Series([1, 2, 3]) + True
   0    2
   1    3
   2    4
   dtype: int64
   ```
   
   And there is a case `allow_bool_index_ops` and `allow_bool` are both `False`, for example
   ```py
   >> ps.Series([True, False, True]) - ps.Series([True, False, True])
   Traceback (most recent call last):
   ...
   TypeError: Subtraction can not be applied to booleans and the given type.
   >>> ps.Series([True, False, True]) - True
   Traceback (most recent call last):
   ...
   TypeError: Subtraction can not be applied to booleans and the given type.
   
   ```
   
   That's why `allow_bool_index_ops` might be needed. Does that make sense?




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

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 change in pull request #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

Posted by GitBox <gi...@apache.org>.
xinrong-databricks commented on a change in pull request #32785:
URL: https://github.com/apache/spark/pull/32785#discussion_r647616907



##########
File path: python/pyspark/pandas/data_type_ops/base.py
##########
@@ -52,33 +52,42 @@
     from pyspark.pandas.series import Series  # noqa: F401 (SPARK-34943)
 
 
-def is_valid_operand_for_numeric_arithmetic(operand: Any, *, allow_bool: bool = True) -> bool:
-    """Check whether the operand is valid for arithmetic operations against numerics."""
+def is_valid_operand_for_numeric_arithmetic(
+    operand: Any, *, allow_bool_index_ops: bool = True, allow_bool: bool = True

Review comment:
       There is a case `allow_bool_index_ops` is not allowed, whereas `allow_bool` is allowed, for example
   ```py
   >>> ps.Series([True, False, True]) + ps.Series([True, False, True])
   Traceback (most recent call last):
   ...
   TypeError: Addition can not be applied to booleans and the given type.
   
   >>> ps.Series([True, False, True]) + True
   0    True
   1    True
   2    True
   dtype: bool
   ```
   
   There is a case `allow_bool_index_ops` and `allow_bool` are both allowed, for example
   ```py
   >>> ps.Series([1, 2, 3]) + ps.Series([True, False, True])
   0    2
   1    2
   2    4
   dtype: int64
   >>> ps.Series([1, 2, 3]) + True
   0    2
   1    3
   2    4
   dtype: int64
   ```
   
   
   Does that answer your question?




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

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 change in pull request #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

Posted by GitBox <gi...@apache.org>.
xinrong-databricks commented on a change in pull request #32785:
URL: https://github.com/apache/spark/pull/32785#discussion_r647616907



##########
File path: python/pyspark/pandas/data_type_ops/base.py
##########
@@ -52,33 +52,42 @@
     from pyspark.pandas.series import Series  # noqa: F401 (SPARK-34943)
 
 
-def is_valid_operand_for_numeric_arithmetic(operand: Any, *, allow_bool: bool = True) -> bool:
-    """Check whether the operand is valid for arithmetic operations against numerics."""
+def is_valid_operand_for_numeric_arithmetic(
+    operand: Any, *, allow_bool_index_ops: bool = True, allow_bool: bool = True

Review comment:
       There is not a case where only bool index should be allowed alone, but here is a case `allow_bool_index_ops` is `False`, whereas `allow_bool` is `True`, for example
   ```py
   >>> ps.Series([True, False, True]) + ps.Series([True, False, True])
   Traceback (most recent call last):
   ...
   TypeError: Addition can not be applied to booleans and the given type.
   
   >>> ps.Series([True, False, True]) + True
   0    True
   1    True
   2    True
   dtype: bool
   ```
   
   In case you are interested, there is a case `allow_bool_index_ops` and `allow_bool` are both `True`, for example
   ```py
   >>> ps.Series([1, 2, 3]) + ps.Series([True, False, True])
   0    2
   1    2
   2    4
   dtype: int64
   >>> ps.Series([1, 2, 3]) + True
   0    2
   1    3
   2    4
   dtype: int64
   ```
   
   And there is a case `allow_bool_index_ops` and `allow_bool` are both `False`, for example
   ```py
   >> ps.Series([True, False, True]) - ps.Series([True, False, True])
   Traceback (most recent call last):
   ...
   TypeError: Subtraction can not be applied to booleans and the given type.
   >>> ps.Series([True, False, True]) - True
   Traceback (most recent call last):
   ...
   TypeError: Subtraction can not be applied to booleans and the given type.
   
   ```
   
   That's why `allow_bool_index_ops` might be needed. Does that make sense?




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

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 #32785: [SPARK-35601][PYTHON] Complete arithmetic operators involving bool literals, Series, and Index

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


   **[Test build #139521 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139521/testReport)** for PR 32785 at commit [`5c0f559`](https://github.com/apache/spark/commit/5c0f55911dc81176ecdc4a8dd8278a6818f00754).
    * 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.

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] ueshin closed pull request #32785: [SPARK-35601][PYTHON] Complete arithmetic operators involving bool literals, Series, and Index

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


   


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

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


   Kubernetes integration test unable to build dist.
   
   exiting with code: 1
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/44032/
   


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

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


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


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

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 #32785: [SPARK-35601][PYTHON] Complete arithmetic operators involving bool literals, Series, and Index

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


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


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

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


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


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

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


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


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

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


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


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

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 #32785: [SPARK-35601][PYTHON] Complete arithmetic operators involving bool literals, Series, and Index

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


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


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

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 #32785: [SPARK-35601][PYTHON] Complete arithmetic operators involving bool literals, Series, and Index

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


   **[Test build #139586 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139586/testReport)** for PR 32785 at commit [`1f9f0e4`](https://github.com/apache/spark/commit/1f9f0e434a45ba953b1be593352089edd2f753db).
    * 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.

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 #32785: [SPARK-35601][PYTHON] Complete arithmetic operators involving bool literals, Series, and Index

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


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


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

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 #32785: [SPARK-35601][PYTHON] Complete arithmetic operators involving bool literals, Series, and Index

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


   **[Test build #139521 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139521/testReport)** for PR 32785 at commit [`5c0f559`](https://github.com/apache/spark/commit/5c0f55911dc81176ecdc4a8dd8278a6818f00754).


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

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 #32785: [SPARK-35601][PYTHON] Complete arithmetic operators involving bool literals, Series, and Index

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


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


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

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 change in pull request #32785: [SPARK-35601][PYTHON] Complete arithmetic operators involving bool literals, Series, and Index

Posted by GitBox <gi...@apache.org>.
xinrong-databricks commented on a change in pull request #32785:
URL: https://github.com/apache/spark/pull/32785#discussion_r647912253



##########
File path: python/pyspark/pandas/data_type_ops/base.py
##########
@@ -52,33 +52,42 @@
     from pyspark.pandas.series import Series  # noqa: F401 (SPARK-34943)
 
 
-def is_valid_operand_for_numeric_arithmetic(operand: Any, *, allow_bool: bool = True) -> bool:
-    """Check whether the operand is valid for arithmetic operations against numerics."""
+def is_valid_operand_for_numeric_arithmetic(
+    operand: Any, *, allow_bool_index_ops: bool = True, allow_bool: bool = True

Review comment:
       The arithmetic operators (+, *) among bool Series/Index has been implemented in this PR; tickets have been adjusted.
   `allow_bool_index_ops` parameter discussed above has been removed.




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

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 change in pull request #32785: [SPARK-35601][PYTHON] Complete arithmetic operators involving bool literals, Series, and Index

Posted by GitBox <gi...@apache.org>.
xinrong-databricks commented on a change in pull request #32785:
URL: https://github.com/apache/spark/pull/32785#discussion_r647912303



##########
File path: python/pyspark/pandas/data_type_ops/base.py
##########
@@ -52,33 +52,42 @@
     from pyspark.pandas.series import Series  # noqa: F401 (SPARK-34943)
 
 
-def is_valid_operand_for_numeric_arithmetic(operand: Any, *, allow_bool: bool = True) -> bool:
-    """Check whether the operand is valid for arithmetic operations against numerics."""
+def is_valid_operand_for_numeric_arithmetic(
+    operand: Any, *, allow_bool_index_ops: bool = True, allow_bool: bool = True

Review comment:
       Thanks @HyukjinKwon, that's helpful!




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

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


   **[Test build #139441 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139441/testReport)** for PR 32785 at commit [`f2ff9c6`](https://github.com/apache/spark/commit/f2ff9c6cdc3e4ba68fa3d63df2a4f70262013adc).
    * 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.

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


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


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

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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



##########
File path: python/pyspark/pandas/data_type_ops/base.py
##########
@@ -52,33 +52,42 @@
     from pyspark.pandas.series import Series  # noqa: F401 (SPARK-34943)
 
 
-def is_valid_operand_for_numeric_arithmetic(operand: Any, *, allow_bool: bool = True) -> bool:
-    """Check whether the operand is valid for arithmetic operations against numerics."""
+def is_valid_operand_for_numeric_arithmetic(
+    operand: Any, *, allow_bool_index_ops: bool = True, allow_bool: bool = True

Review comment:
       Out of curiosity, why do we need `allow_bool_index_ops`? Is there a case where only bool index should be allowed alone?




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

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


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


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

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


   CC @ueshin @HyukjinKwon @itholic 


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

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 #32785: [SPARK-35601][PYTHON] Complete arithmetic operators involving bool literals, Series, and Index

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


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


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

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 #32785: [WIP][SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


   **[Test build #139348 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139348/testReport)** for PR 32785 at commit [`3756dc3`](https://github.com/apache/spark/commit/3756dc3febc2c161eeff54eb9364be1e9511751f).


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

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 #32785: [SPARK-35601][PYTHON] Complete arithmetic operators involving bool literals, Series, and Index

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


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


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

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


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


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

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


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


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

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


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


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

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


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


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

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 change in pull request #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

Posted by GitBox <gi...@apache.org>.
xinrong-databricks commented on a change in pull request #32785:
URL: https://github.com/apache/spark/pull/32785#discussion_r647616907



##########
File path: python/pyspark/pandas/data_type_ops/base.py
##########
@@ -52,33 +52,42 @@
     from pyspark.pandas.series import Series  # noqa: F401 (SPARK-34943)
 
 
-def is_valid_operand_for_numeric_arithmetic(operand: Any, *, allow_bool: bool = True) -> bool:
-    """Check whether the operand is valid for arithmetic operations against numerics."""
+def is_valid_operand_for_numeric_arithmetic(
+    operand: Any, *, allow_bool_index_ops: bool = True, allow_bool: bool = True

Review comment:
       There is a case `allow_bool_index_ops` is not allowed, whereas `allow_bool` is allowed, for example
   ```py
   >>> ps.Series([True, False, True]) + ps.Series([True, False, True])
   Traceback (most recent call last):
   ...
   TypeError: Addition can not be applied to booleans and the given type.
   
   >>> ps.Series([True, False, True]) + True
   0    True
   1    True
   2    True
   dtype: bool
   ```
   
   Does that answer your question?




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

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


   **[Test build #139353 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139353/testReport)** for PR 32785 at commit [`f90000b`](https://github.com/apache/spark/commit/f90000b14c693c808f4d73558888fef37f615d9c).


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

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 #32785: [WIP][SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


   **[Test build #139348 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139348/testReport)** for PR 32785 at commit [`3756dc3`](https://github.com/apache/spark/commit/3756dc3febc2c161eeff54eb9364be1e9511751f).


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

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 change in pull request #32785: [SPARK-35601][PYTHON] Complete arithmetic operators involving bool literals, Series, and Index

Posted by GitBox <gi...@apache.org>.
xinrong-databricks commented on a change in pull request #32785:
URL: https://github.com/apache/spark/pull/32785#discussion_r647912253



##########
File path: python/pyspark/pandas/data_type_ops/base.py
##########
@@ -52,33 +52,42 @@
     from pyspark.pandas.series import Series  # noqa: F401 (SPARK-34943)
 
 
-def is_valid_operand_for_numeric_arithmetic(operand: Any, *, allow_bool: bool = True) -> bool:
-    """Check whether the operand is valid for arithmetic operations against numerics."""
+def is_valid_operand_for_numeric_arithmetic(
+    operand: Any, *, allow_bool_index_ops: bool = True, allow_bool: bool = True

Review comment:
       The arithmetic operators (+, *) among bool Series/Index has been implemented in this PR; tickets have been adjusted.
   `allow_bool_index_ops` parameter has been removed.




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

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 change in pull request #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

Posted by GitBox <gi...@apache.org>.
xinrong-databricks commented on a change in pull request #32785:
URL: https://github.com/apache/spark/pull/32785#discussion_r647616907



##########
File path: python/pyspark/pandas/data_type_ops/base.py
##########
@@ -52,33 +52,42 @@
     from pyspark.pandas.series import Series  # noqa: F401 (SPARK-34943)
 
 
-def is_valid_operand_for_numeric_arithmetic(operand: Any, *, allow_bool: bool = True) -> bool:
-    """Check whether the operand is valid for arithmetic operations against numerics."""
+def is_valid_operand_for_numeric_arithmetic(
+    operand: Any, *, allow_bool_index_ops: bool = True, allow_bool: bool = True

Review comment:
       There is a case `allow_bool_index_ops` is not allowed, thus, `allow_bool` is allowed alone.
   
   `allow_bool_index_ops` is set `True` for arithmetics operations against numeric Series and Indexes in order to enable cases as
   ```py
   >>> ps.Series([1, 2, 3]) + ps.Series([True, False, True])
   0    2                                                                          
   1    2
   2    4
   dtype: int64
   ```
   
   However, the case below is not supported now.
   ```py
   >>> ps.Series([True, False, True]) + ps.Series([True, False, True])
   Traceback (most recent call last):
   ...
   TypeError: Addition can not be applied to booleans and the given type.
   ```
   
   The two cases above both use `is_valid_operand_for_numeric_arithmetic` as an input validation, so `allow_bool_index_ops` might be needed.
   
   How do you think about that?




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

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 #32785: [SPARK-35601][PYTHON] Complete arithmetic operators involving bool literals, Series, and Index

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


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


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

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


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


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

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


   **[Test build #139441 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139441/testReport)** for PR 32785 at commit [`f2ff9c6`](https://github.com/apache/spark/commit/f2ff9c6cdc3e4ba68fa3d63df2a4f70262013adc).


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

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 change in pull request #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

Posted by GitBox <gi...@apache.org>.
xinrong-databricks commented on a change in pull request #32785:
URL: https://github.com/apache/spark/pull/32785#discussion_r647616907



##########
File path: python/pyspark/pandas/data_type_ops/base.py
##########
@@ -52,33 +52,42 @@
     from pyspark.pandas.series import Series  # noqa: F401 (SPARK-34943)
 
 
-def is_valid_operand_for_numeric_arithmetic(operand: Any, *, allow_bool: bool = True) -> bool:
-    """Check whether the operand is valid for arithmetic operations against numerics."""
+def is_valid_operand_for_numeric_arithmetic(
+    operand: Any, *, allow_bool_index_ops: bool = True, allow_bool: bool = True

Review comment:
       There is a case `allow_bool_index_ops` is `False`, whereas `allow_bool` is `True`, for example
   ```py
   >>> ps.Series([True, False, True]) + ps.Series([True, False, True])
   Traceback (most recent call last):
   ...
   TypeError: Addition can not be applied to booleans and the given type.
   
   >>> ps.Series([True, False, True]) + True
   0    True
   1    True
   2    True
   dtype: bool
   ```
   
   There is a case `allow_bool_index_ops` and `allow_bool` are both `True`, for example
   ```py
   >>> ps.Series([1, 2, 3]) + ps.Series([True, False, True])
   0    2
   1    2
   2    4
   dtype: int64
   >>> ps.Series([1, 2, 3]) + True
   0    2
   1    3
   2    4
   dtype: int64
   ```
   
   There is a case `allow_bool_index_ops` and `allow_bool` are both `False`, for example
   ```py
   >> ps.Series([True, False, True]) - ps.Series([True, False, True])
   Traceback (most recent call last):
   ...
   TypeError: Subtraction can not be applied to booleans and the given type.
   >>> ps.Series([True, False, True]) - True
   Traceback (most recent call last):
   ...
   TypeError: Subtraction can not be applied to booleans and the given type.
   
   ```
   
   Does that answer your question?




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

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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






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

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


   **[Test build #139428 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139428/testReport)** for PR 32785 at commit [`ee39236`](https://github.com/apache/spark/commit/ee39236f19406ff8275e33f9f933be95c9048ce6).


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

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 #32785: [SPARK-35601][PYTHON] Complete arithmetic operators involving bool literals, Series, and Index

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


   **[Test build #139593 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139593/testReport)** for PR 32785 at commit [`0489747`](https://github.com/apache/spark/commit/048974727b69fcb1b845c91fdf65c91775b338f4).


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

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


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


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

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


   **[Test build #139507 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139507/testReport)** for PR 32785 at commit [`afe4044`](https://github.com/apache/spark/commit/afe40446a4df45767629fa7ea7612db56a6ec056).


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

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 #32785: [SPARK-35601][PYTHON] Complete arithmetic operators involving bool literals, Series, and Index

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


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


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

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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






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

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 change in pull request #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

Posted by GitBox <gi...@apache.org>.
xinrong-databricks commented on a change in pull request #32785:
URL: https://github.com/apache/spark/pull/32785#discussion_r647792712



##########
File path: python/pyspark/pandas/data_type_ops/boolean_ops.py
##########
@@ -73,7 +77,9 @@ def sub(self, left, right) -> Union["Series", "Index"]:
             return left - right
 
     def mul(self, left, right) -> Union["Series", "Index"]:
-        if not is_valid_operand_for_numeric_arithmetic(right, allow_bool=False):
+        if not is_valid_operand_for_numeric_arithmetic(
+            right, allow_bool_index_ops=False, allow_bool=False

Review comment:
       Good catch! `pd.Series([True, False, True]) * True` and `pd.Series([True, False, True]) * False` are supported.
   
   




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

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


   **[Test build #139441 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139441/testReport)** for PR 32785 at commit [`f2ff9c6`](https://github.com/apache/spark/commit/f2ff9c6cdc3e4ba68fa3d63df2a4f70262013adc).


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

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


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


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

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


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


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

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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



##########
File path: python/pyspark/pandas/data_type_ops/base.py
##########
@@ -52,33 +52,42 @@
     from pyspark.pandas.series import Series  # noqa: F401 (SPARK-34943)
 
 
-def is_valid_operand_for_numeric_arithmetic(operand: Any, *, allow_bool: bool = True) -> bool:
-    """Check whether the operand is valid for arithmetic operations against numerics."""
+def is_valid_operand_for_numeric_arithmetic(
+    operand: Any, *, allow_bool_index_ops: bool = True, allow_bool: bool = True

Review comment:
       BTW, I investigated Nan None True evaluation before at https://github.com/apache/spark/pull/24234/files#diff-2086df5f0cf7291ee71bbde83662c0e34600c53c04ee0e377ceadf61e6c496deR365-R382. might be helpful




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

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 #32785: [WIP][SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


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


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

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


   **[Test build #139438 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/139438/testReport)** for PR 32785 at commit [`2ac8593`](https://github.com/apache/spark/commit/2ac8593809da6dd6936a69c0ae4eca96f419e5bc).
    * This patch **fails PySpark unit 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.

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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






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

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 #32785: [SPARK-35601][PYTHON] Support arithmetic operations against bool literals

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


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


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

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 #32785: [SPARK-35601][PYTHON] Complete arithmetic operators involving bool literals, Series, and Index

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


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


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

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 #32785: [SPARK-35601][PYTHON] Complete arithmetic operators involving bool literals, Series, and Index

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


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


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

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 #32785: [SPARK-35601][PYTHON] Complete arithmetic operators involving bool literals, Series, and Index

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


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


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

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