Skip to content

Commit 93e4b3a

Browse files
committed
Merging master
1 parent 6e2ed5a commit 93e4b3a

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

pandas/_libs/parsers.pyx

+4-4
Original file line numberDiff line numberDiff line change
@@ -1240,10 +1240,10 @@ cdef class TextReader:
12401240
array_type = dtype.construct_array_type()
12411241
try:
12421242
# use _from_sequence_of_strings if the class defines it
1243-
return array_type._from_sequence_of_strings(result,
1243+
result = array_type._from_sequence_of_strings(result,
12441244
dtype=dtype) # noqa
12451245
except AbstractMethodError:
1246-
return array_type._from_sequence(result, dtype=dtype)
1246+
result = array_type._from_sequence(result, dtype=dtype)
12471247
else:
12481248
result = result.astype(dtype)
12491249

@@ -1262,10 +1262,10 @@ cdef class TextReader:
12621262
array_type = dtype.construct_array_type()
12631263
try:
12641264
# use _from_sequence_of_strings if the class defines it
1265-
return array_type._from_sequence_of_strings(result,
1265+
result = array_type._from_sequence_of_strings(result,
12661266
dtype=dtype) # noqa
12671267
except AbstractMethodError:
1268-
return array_type._from_sequence(result, dtype=dtype)
1268+
result = array_type._from_sequence(result, dtype=dtype)
12691269
else:
12701270
result = result.astype(dtype)
12711271
return result, na_count

pandas/core/internals/construction.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,8 @@ def sanitize_array(data, index, dtype=None, copy=False,
558558
subarr = np.array(data, copy=False)
559559

560560
# possibility of nan -> garbage
561-
if is_float_dtype(data.dtype) and is_integer_dtype(dtype):
561+
if is_float_dtype(data.dtype) and is_integer_dtype(dtype) \
562+
and not is_extension_array_dtype(dtype):
562563
if not isna(data).any():
563564
subarr = _try_cast(data, True, dtype, copy,
564565
raise_cast_failure)

pandas/io/parsers.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1669,8 +1669,8 @@ def _convert_to_ndarrays(self, dct, na_values, na_fvalues, verbose=False,
16691669
try_num_bool)
16701670

16711671
# type specified in dtype param
1672-
if cast_type and not (is_dtype_equal(cvals, cast_type)
1673-
or is_extension_array_dtype(cast_type)):
1672+
if cast_type and not is_dtype_equal(cvals, cast_type):
1673+
# or is_extension_array_dtype(cast_type)):
16741674
try:
16751675
if (is_bool_dtype(cast_type) and
16761676
not is_categorical_dtype(cast_type)

0 commit comments

Comments
 (0)