@@ -210,6 +210,26 @@ def _from_sequence(
210210 result = scalars ._data
211211 result = lib .ensure_string_array (result , copy = copy , convert_na_value = False )
212212 pa_arr = pa .array (result , mask = na_values , type = pa .large_string ())
213+ elif isinstance (scalars , ArrowExtensionArray ):
214+ pa_type = scalars ._pa_array .type
215+ # Use PyArrow's native cast for integer, string, and boolean types.
216+ # Float has different representation in PyArrow: 1.0 -> "1" instead
217+ # of "1.0", and uses different scientific notation (1e+10 vs 1e10).
218+ # Boolean needs capitalize (true -> True, false -> False).
219+ if (
220+ pa .types .is_integer (pa_type )
221+ or pa .types .is_large_string (pa_type )
222+ or pa .types .is_string (pa_type )
223+ or pa .types .is_boolean (pa_type )
224+ ):
225+ pa_arr = pc .cast (scalars ._pa_array , pa .large_string ())
226+ if pa .types .is_boolean (pa_type ):
227+ pa_arr = pc .utf8_capitalize (pa_arr )
228+ else :
229+ # Fall back for types where PyArrow's string representation
230+ # differs from Python's str()
231+ result = lib .ensure_string_array (scalars , copy = copy )
232+ pa_arr = pa .array (result , type = pa .large_string (), from_pandas = True )
213233 elif isinstance (scalars , (pa .Array , pa .ChunkedArray )):
214234 pa_arr = pc .cast (scalars , pa .large_string ())
215235 else :
0 commit comments