amoghrajesh commented on code in PR #61461:
URL: https://github.com/apache/airflow/pull/61461#discussion_r2815482327
##########
airflow-core/src/airflow/serialization/definitions/deadline.py:
##########
@@ -226,7 +224,7 @@ def _evaluate_with(self, *, session: Session, **kwargs:
Any) -> datetime | None:
return None
avg_duration_seconds = sum(durations) / len(durations)
- return timezone.utcnow() + timedelta(seconds=avg_duration_seconds)
+ return timezone.utcnow() +
timedelta(seconds=float(avg_duration_seconds))
Review Comment:
Now I remember why, I saw this failure:
```python
airflow-core/tests/unit/models/test_deadline.py:480: in
test_average_runtime_with_min_runs
result = reference.evaluate_with(session=session, interval=interval,
dag_id=DAG_ID)
airflow-core/src/airflow/serialization/definitions/deadline.py:104: in
evaluate_with
base_time = self._evaluate_with(session=session, **filtered_kwargs)
airflow-core/src/airflow/utils/session.py:98: in wrapper
return func(*args, **kwargs)
airflow-core/src/airflow/serialization/definitions/deadline.py:229: in
_evaluate_with
return timezone.utcnow() + timedelta(seconds=avg_duration_seconds)
E TypeError: unsupported type for timedelta seconds component:
decimal.Decimal
```
But I am handling it exactly how it is done by models/deadline:
https://github.com/apache/airflow/blob/main/airflow-core/src/airflow/models/deadline.py#L417-L429
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]