diff --git a/python/cudf/cudf/core/join/_join_helpers.py b/python/cudf/cudf/core/join/_join_helpers.py index 0a20067b41d..3807f408369 100644 --- a/python/cudf/cudf/core/join/_join_helpers.py +++ b/python/cudf/cudf/core/join/_join_helpers.py @@ -1,6 +1,7 @@ # Copyright (c) 2021, NVIDIA CORPORATION. from __future__ import annotations +import collections import warnings from typing import TYPE_CHECKING, Any, Iterable, Tuple @@ -196,7 +197,7 @@ def _match_categorical_dtypes_both( def _coerce_to_tuple(obj): - if hasattr(obj, "__iter__") and not isinstance(obj, str): + if isinstance(obj, collections.abc.Iterable) and not isinstance(obj, str): return tuple(obj) else: return (obj,)