You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "xinrong-meng (via GitHub)" <gi...@apache.org> on 2025/07/10 20:43:15 UTC

[PR] [SPARK-52711][PS] Fix float32 type widening in `mul`/`rmul` under ANSI [spark]

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

   ### What changes were proposed in this pull request?
   Fix float32 type widening in `mul`/`rmul` under ANSI
   
   ### Why are the changes needed?
   Ensure pandas on Spark works well with ANSI mode on.
   Part of https://issues.apache.org/jira/browse/SPARK-52700.
   
   ### Does this PR introduce _any_ user-facing change?
   Yes. `mul`/`rmul` under ANSI works as expected, as shown below.
   
   ```py
   >>> ps.set_option("compute.fail_on_ansi_mode", False)
   >>> ps.set_option("compute.ansi_mode_support", True)
   >>> pser = pd.Series([1.1, 2.2, 3.3], dtype=np.float32)
   >>> psser = ps.from_pandas(pser)
   >>> psser * 1
   0    1.1                                                                        
   1    2.2
   2    3.3
   dtype: float32
   >>> 0.1 * psser
   0    0.11
   1    0.22
   2    0.33
   dtype: float32
   >>> False * psser
   0    0.0
   1    0.0
   2    0.0
   dtype: float32
   ```
   
   ### How was this patch tested?
   Unit tests.
   
   Commands below all passed
   ```
    1133  SPARK_ANSI_SQL_MODE=false  ./python/run-tests --python-executables=python3.11 --testnames "pyspark.pandas.tests.data_type_ops.test_num_mul_div NumMulDivTests.test_mul"
    1134  SPARK_ANSI_SQL_MODE=true  ./python/run-tests --python-executables=python3.11 --testnames "pyspark.pandas.tests.data_type_ops.test_num_mul_div NumMulDivTests.test_mul"
    1136  SPARK_ANSI_SQL_MODE=true  ./python/run-tests --python-executables=python3.11 --testnames "pyspark.pandas.tests.data_type_ops.test_num_reverse ReverseTests.test_rmul"
    1137  SPARK_ANSI_SQL_MODE=false  ./python/run-tests --python-executables=python3.11 --testnames "pyspark.pandas.tests.data_type_ops.test_num_reverse ReverseTests.test_rmul"
   ```
   
   
   ### Was this patch authored or co-authored using generative AI tooling?
   No.
   


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

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

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


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


Re: [PR] [SPARK-52711][PS] Fix float32 type widening in `mul`/`rmul` under ANSI [spark]

Posted by "xinrong-meng (via GitHub)" <gi...@apache.org>.
xinrong-meng closed pull request #51447: [SPARK-52711][PS] Fix float32 type widening in `mul`/`rmul` under ANSI
URL: https://github.com/apache/spark/pull/51447


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

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

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


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


Re: [PR] [SPARK-52711][PS] Fix float32 type widening in `mul`/`rmul` under ANSI [spark]

Posted by "xinrong-meng (via GitHub)" <gi...@apache.org>.
xinrong-meng commented on PR #51447:
URL: https://github.com/apache/spark/pull/51447#issuecomment-3063760225

   Merged to master thanks!


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

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

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


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


Re: [PR] [SPARK-52711][PS] Fix float32 type widening in `mul`/`rmul` under ANSI [spark]

Posted by "xinrong-meng (via GitHub)" <gi...@apache.org>.
xinrong-meng commented on PR #51447:
URL: https://github.com/apache/spark/pull/51447#issuecomment-3059688838

   https://github.com/xinrong-meng/spark/actions/runs/16205438771/job/45754586593 irrelevant test failure, 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.

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

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


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


Re: [PR] [SPARK-52711][PS] Fix float32 type widening in `mul`/`rmul` under ANSI [spark]

Posted by "xinrong-meng (via GitHub)" <gi...@apache.org>.
xinrong-meng commented on PR #51447:
URL: https://github.com/apache/spark/pull/51447#issuecomment-3059695155

   @ueshin may I get a review please? Thanks!


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

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

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


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