def set_define_attr()

in src/pydolphinscheduler/tasks/dependent.py [0:0]


    def set_define_attr(self) -> str:
        """Set attribute to function :func:`get_define`.

        It is a wrapper for both `And` and `Or` operator.
        """
        result = []
        attr = None
        for dependent in self.args:
            if isinstance(dependent, (DependentItem, DependentOperator)):
                if attr is None:
                    attr = repr(dependent)
                elif repr(dependent) != attr:
                    raise PyDSParamException(
                        "Dependent %s operator parameter only support same type.",
                        self.relation,
                    )
            else:
                raise PyDSParamException(
                    "Dependent %s operator parameter support DependentItem and "
                    "DependentOperator but got %s.",
                    (self.relation, type(dependent)),
                )
            result.append(dependent.get_define())
        setattr(self, attr, result)
        return attr