kaxil commented on a change in pull request #7833: Remove super().__init__()
call in backported hooks
URL: https://github.com/apache/airflow/pull/7833#discussion_r396465256
##########
File path: backport_packages/setup_backport_packages.py
##########
@@ -155,6 +155,12 @@ def pure_airflow_models_filter(node: LN, capture:
Capture, filename: Filename) -
"""Check if select is exactly [airflow, . , models]"""
return len([ch for ch in node.children[1].leaves()]) == 3
+ def remove_super_init_call(node: LN, capture: Capture, filename: Filename)
-> None:
+ for ch in node.post_order():
+ if isinstance(ch, Leaf) and ch.value == "super":
+ if any(c.value for c in ch.parent.post_order() if
isinstance(c, Leaf)):
+ ch.parent.remove()
Review comment:
Do you think instead of removing we can change it to **super(BashOperator,
self)** format which is compatible in both Py2 and Py3 ?
----------------------------------------------------------------
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