xinrong-databricks commented on a change in pull request #33275:
URL: https://github.com/apache/spark/pull/33275#discussion_r667097612



##########
File path: python/pyspark/pandas/data_type_ops/string_ops.py
##########
@@ -114,8 +132,8 @@ def astype(self, index_ops: IndexOpsLike, dtype: Union[str, 
type, Dtype]) -> Ind
                     F.length(index_ops.spark.column) > 0
                 )
             return index_ops._with_new_scol(
-                scol.alias(index_ops._internal.data_spark_column_names[0]),
-                field=InternalField(dtype=dtype),
+                scol,
+                field=index_ops._internal.data_fields[0].copy(dtype=dtype, 
spark_type=spark_type),

Review comment:
       Here is `alias(index_ops._internal.data_spark_column_names[0])` removed 
because we are sure that the name of the series is not changed?




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

Reply via email to