Skip to content

Commit

Permalink
fix for datetime type
Browse files Browse the repository at this point in the history
Signed-off-by: Anatoly Myachev <[email protected]>
  • Loading branch information
anmyachev committed Jan 17, 2024
1 parent 86fda1d commit 43e7468
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions modin/core/dataframe/algebra/binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,13 @@ def maybe_compute_dtypes_common_cast(
else [np.array(second).dtype] * len(dtypes_first)
)
elif is_scalar(second) or isinstance(second, np.ndarray):
second_dtypes_list = [
getattr(second, "dtype", None)
or pandas.api.types.pandas_dtype(type(second))
] * len(dtypes_first)
try:
dtype = getattr(second, "dtype", None) or pandas.api.types.pandas_dtype(
type(second)
)
except TypeError:
dtype = pandas.Series(second).dtype
second_dtypes_list = [dtype] * len(dtypes_first)
else:
raise NotImplementedError(
f"Can't compute common type for {type(first)} and {type(second)}."
Expand Down

0 comments on commit 43e7468

Please sign in to comment.