def compare(
        self,
        other: "DataChain",
        on: Union[str, Sequence[str]],
        right_on: Optional[Union[str, Sequence[str]]] = None,
        compare: Optional[Union[str, Sequence[str]]] = None,
        right_compare: Optional[Union[str, Sequence[str]]] = None,
        added: bool = True,
        deleted: bool = True,
        modified: bool = True,
        same: bool = False,
        status_col: Optional[str] = None,
    ) -> "DataChain":
        """Comparing two chains by identifying rows that are added, deleted, modified
        or same. Result is the new chain that has additional column with possible
        values: `A`, `D`, `M`, `U` representing added, deleted, modified and same
        rows respectively. Note that if only one "status" is asked, by setting proper
        flags, this additional column is not created as it would have only one value
        for all rows. Beside additional diff column, new chain has schema of the chain
        on which method was called.

        Parameters:
            other: Chain to calculate diff from.
            on: Column or list of columns to match on. If both chains have the
                same columns then this column is enough for the match. Otherwise,
                `right_on` parameter has to specify the columns for the other chain.
                This value is used to find corresponding row in other dataset. If not
                found there, row is considered as added (or removed if vice versa), and
                if found then row can be either modified or same.
            right_on: Optional column or list of columns
                for the `other` to match.
            compare: Column or list of columns to compare on. If both chains have
                the same columns then this column is enough for the compare. Otherwise,
                `right_compare` parameter has to specify the columns for the other
                chain. This value is used to see if row is modified or same. If
                not set, all columns will be used for comparison
            right_compare: Optional column or list of columns
                    for the `other` to compare to.
            added (bool): Whether to return added rows in resulting chain.
            deleted (bool): Whether to return deleted rows in resulting chain.
            modified (bool): Whether to return modified rows in resulting chain.
            same (bool): Whether to return unchanged rows in resulting chain.
            status_col (str): Name of the new column that is created in resulting chain
                representing diff status.

        Example:
            ```py
            res = persons.compare(
                new_persons,
                on=["id"],
                right_on=["other_id"],
                compare=["name"],
                added=True,
                deleted=True,
                modified=True,
                same=True,
                status_col="diff"
            )
            ```
        """
        from datachain.diff import _compare

        return _compare(
            self,
            other,
            on,
            right_on=right_on,
            compare=compare,
            right_compare=right_compare,
            added=added,
            deleted=deleted,
            modified=modified,
            same=same,
            status_col=status_col,
        )
Comparing two chains by identifying rows that are added, deleted, modified
        or same. Result is the new chain that has additional column with possible
        values: `A`, `D`, `M`, `U` representing added, deleted, modified and same
        rows respectively. Note that if only one "status" is asked, by setting proper
        flags, this additional column is not created as it would have only one value
        for all rows. Beside additional diff column, new chain has schema of the chain
        on which method was called.

        Parameters:
            other: Chain to calculate diff from.
            on: Column or list of columns to match on. If both chains have the
                same columns then this column is enough for the match. Otherwise,
                `right_on` parameter has to specify the columns for the other chain.
                This value is used to find corresponding row in other dataset. If not
                found there, row is considered as added (or removed if vice versa), and
                if found then row can be either modified or same.
            right_on: Optional column or list of columns
                for the `other` to match.
            compare: Column or list of columns to compare on. If both chains have
                the same columns then this column is enough for the compare. Otherwise,
                `right_compare` parameter has to specify the columns for the other
                chain. This value is used to see if row is modified or same. If
                not set, all columns will be used for comparison
            right_compare: Optional column or list of columns
                    for the `other` to compare to.
            added (bool): Whether to return added rows in resulting chain.
            deleted (bool): Whether to return deleted rows in resulting chain.
            modified (bool): Whether to return modified rows in resulting chain.
            same (bool): Whether to return unchanged rows in resulting chain.
            status_col (str): Name of the new column that is created in resulting chain
                representing diff status.

        Example:
            ```py
            res = persons.compare(
                new_persons,
                on=["id"],
                right_on=["other_id"],
                compare=["name"],
                added=True,
                deleted=True,
                modified=True,
                same=True,
                status_col="diff"
            )
            ```
        
src/datachain/lib/dc/datachain.py