https://github.com/apache/airflow/blob/main/airflow/cli/commands/task_command.py#L145
ancestor_map_index = self.map_index * ancestor_ti_count // ti_count
        
        
        
        
        if not _is_further_mapped_inside(upstream, common_ancestor):
            return ancestor_map_index
        
        
        further_count = ti_count // ancestor_ti_count
        map_index_start = ancestor_map_index * further_count
        return range(map_index_start, map_index_start + further_count)
    def clear_db_references(self, session):
        """
        Clear db tables that have a reference to this instance.
        :param session: ORM Session
        :meta private:
        """
        from airflow.models.renderedtifields import RenderedTaskInstanceFields
        tables = [TaskFail, TaskInstanceNote, TaskReschedule, XCom, RenderedTaskInstanceFields]
        for table in tables:
            session.execute(
                delete(table).where(
                    table.dag_id == self.dag_id,
                    table.task_id == self.task_id,
                    table.run_id == self.run_id,
                    table.map_index == self.map_index,
                )
            )
def _find_common_ancestor_mapped_group(node1: Operator, node2: Operator) -> MappedTaskGroup | None: