def check_arithmetics()

in eland/query_compiler.py [0:0]


    def check_arithmetics(self, right: "QueryCompiler") -> None:
        """
        Compare 2 query_compilers to see if arithmetic operations can be performed by the NDFrame object.

        This does very basic comparisons and ignores some of the complexities of incompatible task lists

        Raises exception if incompatible

        Parameters
        ----------
        right: QueryCompiler
            The query compiler to compare self to

        Raises
        ------
        TypeError, ValueError
            If arithmetic operations aren't possible
        """
        if not isinstance(right, QueryCompiler):
            raise TypeError(f"Incompatible types {type(self)} != {type(right)}")

        if self._client != right._client:
            raise ValueError(
                f"Can not perform arithmetic operations across different clients"
                f"{self._client} != {right._client}"
            )

        if self._index.es_index_field != right._index.es_index_field:
            raise ValueError(
                f"Can not perform arithmetic operations across different index fields "
                f"{self._index.es_index_field} != {right._index.es_index_field}"
            )

        if self._index_pattern != right._index_pattern:
            raise ValueError(
                f"Can not perform arithmetic operations across different index patterns"
                f"{self._index_pattern} != {right._index_pattern}"
            )