You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2021/09/30 08:39:07 UTC

[airflow] branch main updated: fix exception string of BranchPythonOperator (#18623)

This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new abdede8  fix exception string of BranchPythonOperator (#18623)
abdede8 is described below

commit abdede8eaf4c82555850067d9a327ab519ffe44a
Author: eladkal <45...@users.noreply.github.com>
AuthorDate: Thu Sep 30 11:38:49 2021 +0300

    fix exception string of BranchPythonOperator (#18623)
---
 airflow/operators/python.py    | 2 +-
 tests/operators/test_python.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/airflow/operators/python.py b/airflow/operators/python.py
index 1aef250..b8ab75f 100644
--- a/airflow/operators/python.py
+++ b/airflow/operators/python.py
@@ -189,7 +189,7 @@ class BranchPythonOperator(PythonOperator, SkipMixin):
         invalid_task_ids = branches - valid_task_ids
         if invalid_task_ids:
             raise AirflowException(
-                f"Branch callable must valid task_ids. Invalid tasks found: {invalid_task_ids}"
+                f"Branch callable must return valid task_ids. Invalid tasks found: {invalid_task_ids}"
             )
         self.skip_all_except(context['ti'], branch)
         return branch
diff --git a/tests/operators/test_python.py b/tests/operators/test_python.py
index 1f7aa66..3adb035 100644
--- a/tests/operators/test_python.py
+++ b/tests/operators/test_python.py
@@ -524,7 +524,7 @@ class TestBranchOperator(unittest.TestCase):
         self.dag.clear()
         with pytest.raises(AirflowException) as ctx:
             branch_op.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE)
-        assert """Branch callable must valid task_ids. Invalid tasks found: {'some_task_id'}""" == str(
+        assert """Branch callable must return valid task_ids. Invalid tasks found: {'some_task_id'}""" == str(
             ctx.value
         )