dag_ids: list[str], *, session: Session
) -> dict[str, dict[str, int | str]]:
    """
    Given a list of dag_ids, get string representing how close any that are dataset triggered are
    their next run, e.g. "1 of 2 datasets updated".
    """
    from airflow.models.dataset import DagScheduleDatasetReference, DatasetDagRunQueue as DDRQ, DatasetModel
    return {
        x.dag_id: {
            "uri": x.uri,
            "ready": x.ready,
            "total": x.total,
        }
        for x in session.query(
            DagScheduleDatasetReference.dag_id,
            
            
            case((func.count() == 1, func.max(DatasetModel.uri)), else_="").label("uri"),
            func.count().label("total"),
            func.sum(case((DDRQ.target_dag_id.is_not(None), 1), else_=0)).label("ready"),
        )
        .join(
            DDRQ,
            and_(
                DDRQ.dataset_id == DagScheduleDatasetReference.dataset_id,
                DDRQ.target_dag_id == DagScheduleDatasetReference.dag_id,
            ),