ashb commented on a change in pull request #21020:
URL: https://github.com/apache/airflow/pull/21020#discussion_r791163599
##########
File path: tests/www/api/experimental/test_dag_runs_endpoint.py
##########
@@ -97,12 +97,8 @@ def test_get_dag_runs_success_with_state_no_result(self):
# Create DagRun
trigger_dag(dag_id=dag_id, run_id='test_get_dag_runs_success')
- response = self.app.get(url_template.format(dag_id))
- assert 200 == response.status_code
- data = json.loads(response.data.decode('utf-8'))
-
- assert isinstance(data, list)
- assert len(data) == 0
+ with pytest.raises(ValueError):
Review comment:
What bit throws the value error here? (It's not clear to from just
looking at the code)
Oh, that `state=dummy` results in a ValueError -- wouldn't that result in a
500 returned, when instead it should be a 400?
##########
File path: airflow/models/dagrun.py
##########
@@ -511,8 +511,12 @@ def update_state(
finished_tasks = info.finished_tasks
unfinished_tasks = info.unfinished_tasks
- none_depends_on_past = all(not t.task.depends_on_past for t in
unfinished_tasks)
- none_task_concurrency = all(t.task.max_active_tis_per_dag is None
for t in unfinished_tasks)
+ none_depends_on_past = all(
+ not t.task.depends_on_past for t in unfinished_tasks # type:
ignore[has-type]
Review comment:
I'm surprised this needs type ignoring.
##########
File path: airflow/models/dagrun.py
##########
@@ -511,8 +511,12 @@ def update_state(
finished_tasks = info.finished_tasks
unfinished_tasks = info.unfinished_tasks
- none_depends_on_past = all(not t.task.depends_on_past for t in
unfinished_tasks)
- none_task_concurrency = all(t.task.max_active_tis_per_dag is None
for t in unfinished_tasks)
+ none_depends_on_past = all(
+ not t.task.depends_on_past for t in unfinished_tasks # type:
ignore[has-type]
Review comment:
Oh, `t.task` could be None as far as typing is concenred?
--
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]