Construct the DAG of this pipeline based on the its operations and their downstream.

def dag(self) -> Tuple[Dict, Dict]:
        """Construct the DAG of this pipeline based on the its operations and their downstream."""
        from pipelines import dags

        operations = self.operations.all().prefetch_related('downstream_operations')

        def get_downstream(op):
            return op.downstream_operations.values_list('id', flat=True)

        return dags.get_dag(operations, get_downstream)