# Buggy code
def _validate_other(
    self,
    other,
    axis,
    numeric_only=False,
    numeric_or_time_only=False,
    numeric_or_object_only=False,
    comparison_dtypes_only=False,
):
    """Helper method to check validity of other in inter-df operations"""
    # We skip dtype checking if the other is a scalar.
    if is_scalar(other):
        return other
    axis = self._get_axis_number(axis) if axis is not None else 1
    result = other
    if isinstance(other, BasePandasDataset):
        return other._query_compiler
    elif is_list_like(other):
        if axis == 0:
            if len(other) != len(self._query_compiler.index):
                raise ValueError(
                    "Unable to coerce to Series, length must be {0}: given {1}".format(
                        len(self._query_compiler.index), len(other)
                    )
                )
        else:
            if len(other) != len(self._query_compiler.columns):
                raise ValueError(
                    "Unable to coerce to Series, length must be {0}: given {1}".format(
                        len(self._query_compiler.columns), len(other)
                    )
                )
        if hasattr(other, "dtype"):
            other_dtypes = [other.dtype] * len(other)
        else:
            other_dtypes = [type(x) for x in other]
    else:
        other_dtypes = [
            type(other)
            for _ in range(
                len(self._query_compiler.index)
                if axis
                else len(self._query_compiler.columns)
            )
        ]
    # Do dtype checking.
    if numeric_only:
        if not all(
            is_numeric_dtype(self_dtype) and is_numeric_dtype(other_dtype)
            for self_dtype, other_dtype in zip(self._get_dtypes(), other_dtypes)
        ):
            raise TypeError("Cannot do operation on non-numeric dtypes")
    elif numeric_or_object_only:
        if not all(
            (is_numeric_dtype(self_dtype) and is_numeric_dtype(other_dtype))
            or (is_object_dtype(self_dtype) and is_object_dtype(other_dtype))
            for self_dtype, other_dtype in zip(self._get_dtypes(), other_dtypes)
        ):
            raise TypeError("Cannot do operation non-numeric dtypes")
    elif comparison_dtypes_only:
        if not all(
            (is_numeric_dtype(self_dtype) and is_numeric_dtype(other_dtype))
            or (
                is_datetime_or_timedelta_dtype(self_dtype)
                and is_datetime_or_timedelta_dtype(other_dtype)
            )
            or is_dtype_equal(self_dtype, other_dtype)
            for self_dtype, other_dtype in zip(self._get_dtypes(), other_dtypes)
        ):
            raise TypeError(
                "Cannot do operation non-numeric objects with numeric objects"
            )
    elif numeric_or_time_only:
        if not all(
            (is_numeric_dtype(self_dtype) and is_numeric_dtype(other_dtype))
            or (
                is_datetime_or_timedelta_dtype(self_dtype)
                and is_datetime_or_timedelta_dtype(other_dtype)
            )
            for self_dtype, other_dtype in zip(self._get_dtypes(), other_dtypes)
        ):
            raise TypeError(
                "Cannot do operation non-numeric objects with numeric objects"
            )
    return result


# Traceback (ValueError)
Traceback (most recent call last):
File "bug.py", line 13, in <module>
print(mdf + ms)
File "/Users/wonchanl/Workspace/modinv/modin/pandas/dataframe.py", line 2084, in __add__
return self.add(other, axis=axis, level=level, fill_value=fill_value)
File "/Users/wonchanl/Workspace/modinv/modin/pandas/dataframe.py", line 480, in add
other, axis=axis, level=level, fill_value=fill_value
File "/Users/wonchanl/Workspace/modinv/modin/pandas/base.py", line 335, in add
"add", other, axis=axis, level=level, fill_value=fill_value
File "/Users/wonchanl/Workspace/modinv/modin/pandas/base.py", line 206, in _binary_op
other = self._validate_other(other, axis, numeric_or_object_only=True)
File "/Users/wonchanl/Workspace/modinv/modin/pandas/base.py", line 136, in _validate_other
len(self._query_compiler.columns), len(other)
ValueError: Unable to coerce to Series, length must be 2: given 1

# Fixed code
def _validate_other(
    self,
    other,
    axis,
    numeric_only=False,
    numeric_or_time_only=False,
    numeric_or_object_only=False,
    comparison_dtypes_only=False,
):
    """Helper method to check validity of other in inter-df operations"""
    # We skip dtype checking if the other is a scalar.
    if is_scalar(other):
        return other
    axis = self._get_axis_number(axis) if axis is not None else 1
    result = other
    if isinstance(other, BasePandasDataset):
        return other._query_compiler
    elif is_list_like(other):
        if isinstance(other, pandas.Series):
            other = other.reindex(self.axes[axis])
        if axis == 0:
            if len(other) != len(self._query_compiler.index):
                raise ValueError(
                    "Unable to coerce to Series, length must be {0}: given {1}".format(
                        len(self._query_compiler.index), len(other)
                    )
                )
        else:
            if len(other) != len(self._query_compiler.columns):
                raise ValueError(
                    "Unable to coerce to Series, length must be {0}: given {1}".format(
                        len(self._query_compiler.columns), len(other)
                    )
                )
        if hasattr(other, "dtype"):
            other_dtypes = [other.dtype] * len(other)
        else:
            other_dtypes = [type(x) for x in other]
    else:
        other_dtypes = [
            type(other)
            for _ in range(
                len(self._query_compiler.index)
                if axis
                else len(self._query_compiler.columns)
            )
        ]
    # Do dtype checking.
    if numeric_only:
        if not all(
            is_numeric_dtype(self_dtype) and is_numeric_dtype(other_dtype)
            for self_dtype, other_dtype in zip(self._get_dtypes(), other_dtypes)
        ):
            raise TypeError("Cannot do operation on non-numeric dtypes")
    elif numeric_or_object_only:
        if not all(
            (is_numeric_dtype(self_dtype) and is_numeric_dtype(other_dtype))
            or (is_object_dtype(self_dtype) and is_object_dtype(other_dtype))
            for self_dtype, other_dtype in zip(self._get_dtypes(), other_dtypes)
        ):
            raise TypeError("Cannot do operation non-numeric dtypes")
    elif comparison_dtypes_only:
        if not all(
            (is_numeric_dtype(self_dtype) and is_numeric_dtype(other_dtype))
            or (
                is_datetime_or_timedelta_dtype(self_dtype)
                and is_datetime_or_timedelta_dtype(other_dtype)
            )
            or is_dtype_equal(self_dtype, other_dtype)
            for self_dtype, other_dtype in zip(self._get_dtypes(), other_dtypes)
        ):
            raise TypeError(
                "Cannot do operation non-numeric objects with numeric objects"
            )
    elif numeric_or_time_only:
        if not all(
            (is_numeric_dtype(self_dtype) and is_numeric_dtype(other_dtype))
            or (
                is_datetime_or_timedelta_dtype(self_dtype)
                and is_datetime_or_timedelta_dtype(other_dtype)
            )
            for self_dtype, other_dtype in zip(self._get_dtypes(), other_dtypes)
        ):
            raise TypeError(
                "Cannot do operation non-numeric objects with numeric objects"
            )
    return result