Skip to content

Commit

Permalink
Replace hasattr with isinstance
Browse files Browse the repository at this point in the history
  • Loading branch information
shwina committed Mar 26, 2021
1 parent 5ad531f commit f7e94fb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/cudf/cudf/core/join/_join_helpers.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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,)

0 comments on commit f7e94fb

Please sign in to comment.