You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "jedcunningham (via GitHub)" <gi...@apache.org> on 2023/06/22 22:16:29 UTC
[GitHub] [airflow] jedcunningham commented on a diff in pull request #32061: Check that chain_linear elements has len greater than 1
jedcunningham commented on code in PR #32061:
URL: https://github.com/apache/airflow/pull/32061#discussion_r1239080627
##########
airflow/models/baseoperator.py:
##########
@@ -1860,6 +1860,8 @@ def chain_linear(*elements: DependencyMixin | Sequence[DependencyMixin]):
:param elements: a list of operators / lists of operators
"""
+ if len(elements) == 1:
+ raise ValueError("elements has length 1; did you forget to expand your list with `*`?")
Review Comment:
"elements" feels a little weird to me here. Maybe something like:
```suggestion
raise ValueError("Only 1 task or list of tasks passed; did you forget to expand your list with `*`?")
```
Maybe save the "did you forget to expand" addition if the one thing we got is an iterable?
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org