@@ -371,7 +371,6 @@ def _from_sequence_of_strings(
371
371
scalars = strings .cast (pa .int64 ())
372
372
except pa .ArrowInvalid :
373
373
pass
374
-
375
374
elif pa .types .is_time (pa_type ):
376
375
from pandas .core .tools .times import to_time
377
376
@@ -399,18 +398,10 @@ def _from_sequence_of_strings(
399
398
from pandas .core .tools .numeric import to_numeric
400
399
401
400
scalars = to_numeric (strings , errors = "raise" )
402
- if not pa .types .is_decimal (pa_type ) and isinstance (
403
- strings , (pa .Array , pa .ChunkedArray )
404
- ):
405
- # TODO: figure out why doing this cast breaks with decimal dtype
406
- # in test_from_sequence_of_strings_pa_array
407
- mask = strings .is_null ()
408
- scalars = pa .array (scalars , mask = np .array (mask ), type = pa_type )
409
- # TODO: could we just do strings.cast(pa_type)?
410
- elif isinstance (strings , (pa .Array , pa .ChunkedArray )):
401
+ if isinstance (strings , (pa .Array , pa .ChunkedArray )):
411
402
scalars = strings .cast (pa_type )
412
403
elif mask is not None :
413
- scalars = pa .array (scalars , mask = mask . view ( bool ) , type = pa_type )
404
+ scalars = pa .array (scalars , mask = mask , type = pa_type )
414
405
415
406
else :
416
407
raise NotImplementedError (
0 commit comments