Skip to content

Commit 41d9d32

Browse files
committed
removed 'do_convert' local var from 'convert_to_unicode'
1 parent 604fc73 commit 41d9d32

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

pandas/_libs/lib.pyx

+4-6
Original file line numberDiff line numberDiff line change
@@ -2329,22 +2329,21 @@ cdef inline object convert_to_unicode(object item,
23292329
23302330
Returns
23312331
-------
2332-
str
2332+
str or int or float
23332333
"""
23342334
cdef:
2335-
bint do_convert = 1
23362335
float64_t float_item
23372336

23382337
if keep_trivial_numbers:
23392338
if isinstance(item, int):
23402339
if <int>item == 0:
2341-
do_convert = 0
2340+
return item
23422341
elif isinstance(item, float):
23432342
float_item = item
23442343
if float_item == 0.0 or float_item != float_item:
2345-
do_convert = 0
2344+
return item
23462345

2347-
if do_convert and not isinstance(item, str):
2346+
if not isinstance(item, str):
23482347
item = PyObject_Str(item)
23492348

23502349
return item
@@ -2388,7 +2387,6 @@ def _concat_date_cols(tuple date_cols, bint keep_trivial_numbers=True):
23882387
if col_count == 0:
23892388
return np.zeros(0, dtype=object)
23902389

2391-
23922390
if not all(util.is_array(array) for array in date_cols):
23932391
raise ValueError("not all elements from date_cols are numpy arrays")
23942392

0 commit comments

Comments
 (0)