def _as_delta(
        self,
        on: Optional[Union[str, Sequence[str]]] = None,
        right_on: Optional[Union[str, Sequence[str]]] = None,
        compare: Optional[Union[str, Sequence[str]]] = None,
        delta_retry: Optional[Union[bool, str]] = None,
    ) -> "Self":
        """Marks this chain as delta, which means special delta process will be
        called on saving dataset for optimization"""
        if on is None:
            raise ValueError("'delta on' fields must be defined")
        self._delta = True
        self._delta_on = on
        self._delta_result_on = right_on
        self._delta_compare = compare
        self._delta_retry = delta_retry
        return self
Marks this chain as delta, which means special delta process will be
        called on saving dataset for optimization
src/datachain/lib/dc/datachain.py