### Description

A count of datasets that are currently registered/declared in an Airflow deployment.

### Use case/motivation

Would be nice to see how deployments are adopting datasets.

### Related issues

_No response_

### Are you willing to submit a PR?

- [ ] Yes I am willing to submit a PR!

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)

"""
        Find zombie task instances, which are tasks haven't heartbeated for too long
        or have a no-longer-running LocalTaskJob, and create a TaskCallbackRequest
        to be handled by the DAG processor.
        """
        from airflow.jobs.local_task_job import LocalTaskJob
        self.log.debug("Finding 'running' jobs without a recent heartbeat")
        limit_dttm = timezone.utcnow() - timedelta(seconds=self._zombie_threshold_secs)
        with create_session() as session:
            zombies: list[tuple[TI, str, str]] = (
                session.query(TI, DM.fileloc, DM.processor_subdir)
                .with_hint(TI, "USE INDEX (ti_state)", dialect_name="mysql")
                .join(LocalTaskJob, TI.job_id == LocalTaskJob.id)
                .join(DM, TI.dag_id == DM.dag_id)
                .filter(TI.state == TaskInstanceState.RUNNING)
                .filter(
                    or_(
                        LocalTaskJob.state != State.RUNNING,
                        LocalTaskJob.latest_heartbeat < limit_dttm,
                    )
                )
                .filter(TI.queued_by_job_id == self.id)
                .all()