xinrong-databricks commented on a change in pull request #33466:
URL: https://github.com/apache/spark/pull/33466#discussion_r675694702
##########
File path: python/pyspark/pandas/data_type_ops/num_ops.py
##########
@@ -371,15 +384,7 @@ def isnull(self, index_ops: IndexOpsLike) -> IndexOpsLike:
def astype(self, index_ops: IndexOpsLike, dtype: Union[str, type, Dtype])
-> IndexOpsLike:
dtype, spark_type = pandas_on_spark_type(dtype)
-
- if isinstance(dtype, CategoricalDtype):
- return _as_categorical_type(index_ops, dtype, spark_type)
- elif isinstance(spark_type, BooleanType):
- return _as_bool_type(index_ops, dtype)
- elif isinstance(spark_type, StringType):
- return _as_string_type(index_ops, dtype, null_str=str(np.nan))
- else:
- return _as_other_type(index_ops, dtype, spark_type)
+ return _non_fractional_astype(index_ops, dtype, spark_type)
Review comment:
`hasnans` of Decimal may not work as expected as
https://issues.apache.org/jira/browse/SPARK-36230.
A TODO comment is added. 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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]