Skip to content

Commit 29834d7

Browse files
committed
changes
1 parent 38ac629 commit 29834d7

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

pandas/core/common.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from datetime import datetime, timedelta
1010
from functools import partial
1111
import inspect
12-
from typing import Any
12+
from typing import Any, Iterable, Union
1313

1414
import numpy as np
1515

@@ -289,7 +289,7 @@ def maybe_make_list(obj):
289289
return obj
290290

291291

292-
def maybe_itarable_to_list(obj: Any) -> Any:
292+
def maybe_iterable_to_list(obj: Union[Iterable, Any]) -> Union[list, Any]:
293293
"""
294294
If obj is Iterable but not list-like, consume into list.
295295
"""

pandas/core/internals/construction.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def init_dict(data, index, columns, dtype=None):
197197
else:
198198
keys = com.dict_keys_to_ordered_list(data)
199199
columns = data_names = Index(keys)
200-
arrays = (com.maybe_itarable_to_list(data[k]) for k in keys)
200+
arrays = (com.maybe_iterable_to_list(data[k]) for k in keys)
201201
# GH#24096 need copy to be deep for datetime64tz case
202202
# TODO: See if we can avoid these copies
203203
arrays = [arr if not is_datetime64tz_dtype(arr) else

pandas/core/series.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ def __init__(self, data=None, index=None, dtype=None, name=None,
224224
# handle sparse passed here (and force conversion)
225225
data = data.to_dense()
226226
else:
227-
data = com.maybe_itarable_to_list(data)
227+
data = com.maybe_iterable_to_list(data)
228228

229229
if index is None:
230230
if not is_list_like(data):

pandas/tests/frame/test_constructors.py

+1
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,7 @@ def test_constructor_dict_of_tuples(self):
534534
tm.assert_frame_equal(result, expected, check_dtype=False)
535535

536536
def test_constructor_dict_of_ranges(self):
537+
# GH 26356
537538
data = {'a': range(3), 'b': range(3, 6)}
538539

539540
result = DataFrame(data)

0 commit comments

Comments
 (0)