New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove super().__init__() call in backported hooks #7833
Remove super().__init__() call in backported hooks #7833
Conversation
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() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think instead of removing we can change it to super(BashOperator, self) format which is compatible in both Py2 and Py3 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is in signature:
[2020-03-23 09:16:06,795] {standard_task_runner.py:53} INFO - Started process 587 to run task
[2020-03-23 09:16:07,040] {logging_mixin.py:112} INFO - Running %s on host %s <TaskInstance: example_gcp_function.gcf_deploy_task 2020-03-22T00:00:00+00:00 [running]> bac65bcc36b9
[2020-03-23 09:16:07,078] {taskinstance.py:1128} ERROR - __init__() missing 1 required positional argument: 'source'
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/airflow/models/taskinstance.py", line 966, in _run_raw_task
result = task_copy.execute(context=context)
File "/usr/local/lib/python3.6/site-packages/airflow/providers/google/cloud/operators/functions.py", line 194, in execute
hook = CloudFunctionsHook(gcp_conn_id=self.gcp_conn_id, api_version=self.api_version)
File "/usr/local/lib/python3.6/site-packages/airflow/providers/google/cloud/hooks/functions.py", line 50, in __init__
super().__init__(gcp_conn_id, delegate_to)
File "/usr/local/lib/python3.6/site-packages/airflow/providers/google/cloud/hooks/base.py", line 158, in __init__
super().__init__()
TypeError: __init__() missing 1 required positional argument: 'source'
[2020-03-23 09:16:07,085] {taskinstance.py:1185} INFO - Marking task as FAILED.dag_id=example_gcp_function, task_id=gcf_deploy_task, execution_date=20200322T000000, start_date=20200323T091606, end_date=20200323T091607
The 1.10 signature:
airflow/airflow/hooks/base_hook.py
Lines 37 to 46 in 655f0cd
class BaseHook(LoggingMixin): | |
""" | |
Abstract base class for hooks, hooks are meant as an interface to | |
interact with external systems. MySqlHook, HiveHook, PigHook return | |
object that can handle the connection and interaction to specific | |
instances of these systems, and expose consistent methods to interact | |
with them. | |
""" | |
def __init__(self, source): | |
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On actual master the super().__init__()
calls LoggingMixin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
argghhh, in that case, removal is better I agree 👍
Codecov Report
@@ Coverage Diff @@
## master #7833 +/- ##
==========================================
- Coverage 86.95% 86.64% -0.32%
==========================================
Files 926 926
Lines 44974 44975 +1
==========================================
- Hits 39109 38969 -140
- Misses 5865 6006 +141
Continue to review full report at Codecov.
|
The CI is green but the status was not updated :< @potiuk should we merge? |
Issue link: WILL BE INSERTED BY boring-cyborg
Make sure to mark the boxes below before creating PR: [x]
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.
Read the Pull Request Guidelines for more information.