TI.state: State.SUCCESS,
                            TI.start_date: timezone.utcnow(),
                            TI.end_date: timezone.utcnow(),
                            TI.duration: 0,
                        },
                        synchronize_session=False,
                    )
                )
        return count
    @provide_session
    def get_log_template(self, *, session: Session = NEW_SESSION) -> LogTemplate:
        if self.log_template_id is None:  
            template = session.query(LogTemplate).order_by(LogTemplate.id).first()
        else:
            template = session.get(LogTemplate, self.log_template_id)
        if template is None:
            raise AirflowException(
                f"No log_template entry found for ID {self.log_template_id!r}. "
                f"Please make sure you set up the metadatabase correctly."
            )
        return template
    @provide_session
    def get_log_filename_template(self, *, session: Session = NEW_SESSION) -> str:
        warnings.warn(
            "This method is deprecated. Please use get_log_template instead.",
            RemovedInAirflow3Warning,
            stacklevel=2,
        )
        return self.get_log_template(session=session).filename
class DagRunNote(Base):