xinrong-meng commented on code in PR #52133: URL: https://github.com/apache/spark/pull/52133#discussion_r2302313806
########## python/pyspark/pandas/data_type_ops/boolean_ops.py: ########## @@ -321,6 +322,13 @@ def astype(self, index_ops: IndexOpsLike, dtype: Union[str, type, Dtype]) -> Ind ), ) else: + is_ansi = is_ansi_mode_enabled(index_ops._internal.spark_frame.sparkSession) + if is_ansi and get_option("compute.eager_check"): + if is_integer_dtype(dtype) and not isinstance(dtype, extension_dtypes): + if index_ops.hasnans: + raise ValueError( Review Comment: Consistent with https://github.com/apache/spark/blob/master/python/pyspark/pandas/data_type_ops/num_ops.py#L552 -- 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-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org