Skip to content

Commit d922a51

Browse files
committed
Update check
1 parent df30233 commit d922a51

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

pandas/core/reshape/concat.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@
1818
from pandas._libs import lib
1919
from pandas.util._exceptions import find_stack_level
2020

21-
from pandas.core.dtypes.common import is_bool
21+
from pandas.core.dtypes.common import (
22+
is_bool,
23+
is_scalar,
24+
)
2225
from pandas.core.dtypes.concat import concat_compat
2326
from pandas.core.dtypes.generic import (
2427
ABCDataFrame,
@@ -726,14 +729,12 @@ def _clean_keys_and_objs(
726729
if keys is None:
727730
keys = objs.keys()
728731
objs = [objs[k] for k in keys]
729-
elif isinstance(objs, (ABCSeries, ABCDataFrame, str)):
732+
elif isinstance(objs, (ABCSeries, ABCDataFrame)) or is_scalar(objs):
730733
raise TypeError(
731734
"first argument must be an iterable of pandas "
732735
f'objects, you passed an object of type "{type(objs).__name__}"'
733736
)
734-
elif isinstance(objs, (list, tuple, np.ndarray)):
735-
pass
736-
else:
737+
elif not isinstance(objs, abc.Sized):
737738
objs = list(objs)
738739

739740
if len(objs) == 0:
Binary file not shown.

0 commit comments

Comments
 (0)