mik-laj commented on a change in pull request #6950: [AIRFLOW-6392] Remove
cyclic dependency baseoperator <-> helpers
URL: https://github.com/apache/airflow/pull/6950#discussion_r361927339
##########
File path: airflow/utils/helpers.py
##########
@@ -142,83 +135,6 @@ def as_flattened_list(iterable):
return [e for i in iterable for e in i]
-def chain(*tasks):
Review comment:
The existence of the idea of creating an automatic tool does not affect
whether we should or should not make changes.
Others look much less used, although there may be someone who finds these
functions. But in my opinion, this is the choice of the lesser evil.
I don't see the benefits of creating static methods in Python. Why do you
think it's worth creating a static method? It would be easier for me to write
```
chain ([taskA], [taskB])
```
than
```
BaseOperator.chain ([taskA], [taskB])
```
It is not possible to import a single static method into a file. You must
always import the whole class. A similar opinion was expressed in "[Google
Python Style Guide](http://google.github.io/styleguide/pyguide.html)":
> Use decorators judiciously when there is a clear advantage. Avoid
@staticmethod and limit use of @classmethod.
For me, creating a large number of static methods is less pythonic. Python
is a multi-paradigm language, and choosing an OOP approach is not the only
solution. In Java, this is the only solution
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services