[AIRFLOW-XXXX] Remove unnecessary docstring in AWSAthenaOperator#9517
Conversation
|
This change looks good. The earliest history I see for this file is in November 2019, at which point the Athena operator did not make use of |
There was a problem hiding this comment.
I think this is still valid because:
airflow/airflow/models/taskinstance.py
Lines 1035 to 1037 in 7a54418
There was a problem hiding this comment.
If operator's execute method returns a result it doesn't mean that it will be always saved in XCom table. This will happen only if operator is used with do_xcom_push=True
There was a problem hiding this comment.
Got it, that makes sense. This behavior seems to correspond to the super classes and not to this specific class, hence why I don't think it needs to be mentioned in the docstring. Does that make sense?
There was a problem hiding this comment.
Here is the setting in BaseOperator on master. Since operator docstrings usually do not mention super class functionality, I think this could be removed. The behavior should be evident by looking at the super class and understanding that query_execution_id is the value in question that will or will not be xcom_pushed.
There was a problem hiding this comment.
Since operator docstrings usually do not mention super class functionality, I think this could be removed.
With that I can agree. My point was that this part of the PR description is not true:
Since query_execution_id is now returned by execute, it will be xcom
pushed by default
There was a problem hiding this comment.
Noted! Just updated the PR description and title to reflect the full context. Thanks for pointing that out!
100d43b to
570f315
Compare
|
@turbaszek - just rebased and cleaned up the wording a bit. Apologies that I didn't see your approval first. Please let me know if it still stands. |
Since query_execution_id is returned by execute, it will be xcom_pushed by default. Since do_xcom_push is a setting in the super class, BaseOperator, it need not be mentioned in the docstring.
570f315 to
4dfc25b
Compare
EDIT - here is the updated PR description:
query_execution_idis returned byexecute, which means that the default behavior is that it will bexcom_pushed. While this can be overridden since this is a subclass ofBaseOperatorand this is an argument that is accepted, it need not be mentioned in the docstring here since it is referring to default behavior.Old PR description for transparency:
Since query_execution_id is now returned by execute, it will be xcompushed by default, meaning
do_xcom_pushis no longer needed and shouldnot be mentioned in the docstring.
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.