Skip to content

Conversation

@deedmitrij
Copy link
Contributor


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
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.

@boring-cyborg
Copy link

boring-cyborg bot commented Aug 17, 2021

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
Here are some useful points:

  • Pay attention to the quality of your code (flake8, mypy and type annotations). Our pre-commits will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it’s a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

@uranusjr
Copy link
Member

What is the reason behind the change?

@deedmitrij deedmitrij changed the title Add AirflowException in case of error during cmd command executing Create CMDExecutor for raising an exception in case of error during cmd execution Aug 19, 2021
@deedmitrij
Copy link
Contributor Author

I've totally updated the commit.
Main reason of changes is to raise an exception in case of error during cmd execution. We do not want to continue tests performing in case of error during cmd execution. So, the best decision was to create a separate class inherited from the LoggingCommandExecutor and re-write parent execute_cmd method with desired behavior.

@deedmitrij
Copy link
Contributor Author

@potiuk could you, please, review this my commit also? ;)

@uranusjr
Copy link
Member

I think the exception may need a better name. What is cmd? Is it specific to Google Cloud? If not, why is it only used in the Google provider? The current class name and documentation is much too vague and would be problematic for future maintainers.

@deedmitrij
Copy link
Contributor Author

@uranusjr cmd is an acronym for "command". This is not specific to Google, but for now is used only in Google because we need to raise an exception in case of any errors during command execution (original logic in the parent class just returns the status code of command execution). That's why we decided to leave the original logic and create the separate class which raises the exception in case of error during command execution, so if someone in future requires such behavior too, they will be able to use this class.

@uranusjr
Copy link
Member

Thanks for the explaination. I think it should be included in the source code (either in docstring or a comment).

@deedmitrij
Copy link
Contributor Author

Ok, I will add this info

@deedmitrij
Copy link
Contributor Author

@uranusjr I've added the docstring. Please, review

@deedmitrij deedmitrij force-pushed the system_tests branch 2 times, most recently from ca8eea1 to c461fae Compare September 29, 2021 17:12
@deedmitrij deedmitrij requested a review from uranusjr October 15, 2021 09:04
Copy link
Member

@uranusjr uranusjr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You haven't addressed any of the previous review comments; I don't have anything new

@uranusjr uranusjr changed the title Create CMDExecutor for raising an exception in case of error during cmd execution Create CommandExecutor for raising an exception in case of error during cmd execution Oct 21, 2021
@github-actions github-actions bot added the full tests needed We need to run full set of tests for this PR to merge label Oct 21, 2021
@github-actions
Copy link

The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.

@deedmitrij
Copy link
Contributor Author

@uranusjr Can we merge this PR?

@potiuk potiuk merged commit df46549 into apache:main Oct 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full tests needed We need to run full set of tests for this PR to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants