fangchenli commented on code in PR #53763:
URL: https://github.com/apache/spark/pull/53763#discussion_r2688275627


##########
python/pyspark/tests/upstream/pyarrow/test_pyarrow_array_to_pandas.py:
##########
@@ -0,0 +1,429 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""
+Tests for PyArrow pa.Array.to_pandas with default arguments.
+
+This module tests how PyArrow converts Arrow arrays to pandas Series using
+default arguments. PySpark uses pa.Array.to_pandas() to convert Arrow data
+to numpy-backed pandas DataFrames for pandas UDFs.
+
+With default arguments, to_pandas() converts Arrow arrays to numpy-backed
+pandas Series, which is important for PySpark's type handling.
+"""
+
+import datetime
+import math
+import unittest
+from decimal import Decimal
+
+from pyspark.testing.utils import (
+    have_pandas,
+    have_pyarrow,
+    pandas_requirement_message,
+    pyarrow_requirement_message,
+)
+
+
[email protected](
+    not have_pyarrow or not have_pandas,
+    pyarrow_requirement_message if not have_pyarrow else 
pandas_requirement_message,
+)
+class PyArrowArrayToPandasTests(unittest.TestCase):
+    """Test pa.Array.to_pandas with default arguments."""
+
+    def test_integer_types(self):
+        """Test conversion of integer arrays to pandas."""
+        import numpy as np
+        import pandas as pd
+        import pyarrow as pa
+
+        # (arrow_type, values, expected_numpy_dtype)
+        test_cases = [

Review Comment:
   > are there ways to convert to ArrowDtype? or maybe that's not default 
arguments and belong to another test?
   
   That is not the default, and belongs to another test.



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

Reply via email to