uranusjr commented on a change in pull request #21054:
URL: https://github.com/apache/airflow/pull/21054#discussion_r790424466
##########
File path: airflow/models/baseoperator.py
##########
@@ -742,6 +742,16 @@ def __init__(
]
)
+ if isinstance(self.template_fields, str):
+ warnings.warn(
+ f"The `template_fields` value for {self.task_type} is a string
"
+ "but should be a Sequence type. Converting to a Sequence type
for execution. "
+ f"Please update {self.task_type} accordingly.",
Review comment:
```suggestion
f"The `template_fields` value for {self.task_type} is a
string "
"but should be a list of string. Wrapping it in a list for
execution. "
f"Please update {self.task_type} accordingly.",
```
`str` is _technically_ a string, so _sequence of string_ is a better term.
But I feel the term _sequence_ itself might not be the easiest to understand
for less experienced developers, so let’s just recommend using a list instead,
which is the most fool-proof syntax.
--
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]