dstandish edited a comment on pull request #13423:
URL: https://github.com/apache/airflow/pull/13423#issuecomment-774741417


   hey @turbaszek @ashb @kaxil 
   
   rebased after merge of [BashOperator to raise AirflowSkipException on exit 
code 127](https://github.com/apache/airflow/pull/13421)
   
   that change has implications for this one
   
   what i have done for now is keep the skip logic in the `run_command` 
function, along with the fail logic.
   
   this means that the skip logic would stay with the hook
   
   i feel a little iffy about this.  on one hand i think skip / fail logic is 
best handled in the operator -- that the hook should not have an opinion about 
this.
   
   on the other hand, hooks are only used in the running of an operator, so it 
is legitimate to have this kind of logic here.
   
   if we want operator to handle, i was thinking `run_command` could return 
`namedtuple('SubprocessResult', ['exit_code', 'output'])` and then let the 
caller decide what to do. `run_command` it would not raise _any_ exception 
based on exit code -- it would just provide code along with output
   
   please let me know your thoughts on which way is best 🙏
   
   small note: i think will be nice to parameterize returning all output vs 
last line but this can be added in later pr.
   
   
   


----------------------------------------------------------------
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]


Reply via email to