You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "uranusjr (via GitHub)" <gi...@apache.org> on 2023/09/12 01:35:48 UTC
[GitHub] [airflow] uranusjr commented on a diff in pull request #34278: Refactor: Think positively
uranusjr commented on code in PR #34278:
URL: https://github.com/apache/airflow/pull/34278#discussion_r1322263014
##########
airflow/example_dags/example_params_trigger_ui.py:
##########
@@ -89,13 +89,13 @@ def generate_french_greeting(name: str) -> str:
@task(task_id="print_greetings", trigger_rule=TriggerRule.ALL_DONE)
def print_greetings(greetings1, greetings2, greetings3) -> None:
- for g in greetings1 if greetings1 else []:
+ for g in greetings1 or []:
print(g)
- for g in greetings2 if greetings2 else []:
+ for g in greetings2 or []:
print(g)
- for g in greetings3 if greetings3 else []:
+ for g in greetings3 or []:
print(g)
- if not greetings1 and not greetings2 and not greetings3:
+ if not any((greetings1, greetings2, greetings3)):
Review Comment:
I like the original code better tbh. Or
```python
if not (greetings1 or greetings2 or greetings3):
```
--
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