Skip to content
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

[AIRFLOW-6657] Deprecate BaseBranchOperator #7331

Closed
wants to merge 1 commit into from

Conversation

yuqian90
Copy link
Contributor

@yuqian90 yuqian90 commented Feb 2, 2020

Everything that can be done by deriving from BaseBranchOperator can also be done using BranchPythonOperator with more concise and readable code.

E.g. LatestOnlyOperator can be implemented from BranchPythonOperator easily. The test tasks in test_branch_operator.py are also better implemented using BranchPythonOperator like the ones in tests/operators/test_python.py

The changes in this PR to LatestOnlyOperator does not require additional testing because there's already a test_latest_only_operator.py that works fine after the change.


Issue link: AIRFLOW-6657

Make sure to mark the boxes below before creating PR: [x]

  • Description above provides context of the change
  • Commit message/PR title starts with [AIRFLOW-NNNN]. AIRFLOW-NNNN = JIRA ID*
  • Unit tests coverage for changes (not needed for documentation changes)
  • Commits follow "How to write a good git commit message"
  • Relevant documentation is updated including usage instructions.
  • I will engage committers as explained in Contribution Workflow Example.

* For document-only changes commit message can start with [AIRFLOW-XXXX].


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.

@yuqian90 yuqian90 changed the title [AIRFLOW-6657] Deprecate branch operator [AIRFLOW-6657] Deprecate BaseBranchOperator Feb 2, 2020
@ashb
Copy link
Member

ashb commented Feb 26, 2020

Did we make any decisions on if we need this or not? I remember there was a chat somewhere after you opened this PR.

@yuqian90
Copy link
Contributor Author

Did we make any decisions on if we need this or not? I remember there was a chat somewhere after you opened this PR.

Hi @ashb I did post the PR in #development but I don't think people replied back then. But you are right we should discuss if BaseBranchOperator should be deprecated.

I read the discussion history on #5231. My understanding is @chronitis originally added BaseBranchOperator when most of the skipping logic lived inside BranchPythonOperator itself. He then went on to refactor BranchPythonOperator and SkipMixin. He did a good job refactoring them till a point where almost all of the logic now lives in SkipMixin.skip_all_except() itself, making it much more reusable. So it rendered BaseBranchOperator much less useful (because people can use SkipMixin directly if they wish).

Also as I pointed out, whatever we can do with BaseBranchOperator can also be done with BranchPythonOperator. That's why i find it unnecessary to have a separate class.

@chronitis @ashb please let me know what you think.

@stale
Copy link

stale bot commented Apr 13, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Stale PRs per the .github/workflows/stale.yml policy file label Apr 13, 2020
@stale stale bot closed this Apr 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Stale PRs per the .github/workflows/stale.yml policy file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants