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-3375] Support returning multiple tasks with BranchPythonOperator #4215

Merged
merged 1 commit into from Nov 21, 2018

Conversation

Projects
None yet
3 participants
@BasPH
Copy link
Contributor

BasPH commented Nov 20, 2018

Make sure you have checked all steps below.

Jira

  • My PR addresses the following Airflow Jira issues and references them in the PR title. For example, "[AIRFLOW-XXX] My Airflow PR"

https://issues.apache.org/jira/browse/AIRFLOW-3375

Description

  • Here are some details about my PR, including screenshots of any UI changes:

This PR adds support to the BranchPythonOperator for handling a list of tasks, so multiple branches can be returned. A single task_id string is still supported.

This is now possible with this PR:
image

By returning a list of task ids:
BranchPythonOperator(task_id='your_dag', dag=dag, python_callable=lambda: ['branch_1', 'branch_2'])

Tests

  • My PR adds the following unit tests OR does not need testing for this extremely good reason:

Added test_branch_list_without_dag_run test to BranchOperatorTest.

Commits

  • My commits all reference Jira issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "How to write a good git commit message":
    1. Subject is separated from body by a blank line
    2. Subject is limited to 50 characters (not including Jira issue reference)
    3. Subject does not end with a period
    4. Subject uses the imperative mood ("add", not "adding")
    5. Body wraps at 72 characters
    6. Body explains "what" and "why", not "how"

Documentation

  • In case of new functionality, my PR adds documentation that describes how to use it.
    • When adding new operators/hooks/sensors, the autoclass documentation generation needs to be added.

Added new functionality in parentheses.

Code Quality

  • Passes flake8
@codecov-io

This comment has been minimized.

Copy link

codecov-io commented Nov 20, 2018

Codecov Report

Merging #4215 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4215      +/-   ##
==========================================
+ Coverage   77.82%   77.82%   +<.01%     
==========================================
  Files         201      201              
  Lines       16339    16341       +2     
==========================================
+ Hits        12716    12718       +2     
  Misses       3623     3623
Impacted Files Coverage Δ
airflow/operators/python_operator.py 95.09% <100%> (+0.06%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5c7e4e4...b7e8202. Read the comment docs.

@Fokko

Fokko approved these changes Nov 21, 2018

Copy link
Contributor

Fokko left a comment

Love it @BasPH. Thanks!

@Fokko Fokko merged commit ad2c968 into apache:master Nov 21, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

tmiller-msft added a commit to cse-airflow/incubator-airflow that referenced this pull request Nov 27, 2018

elizabethhalper added a commit to cse-airflow/incubator-airflow that referenced this pull request Dec 7, 2018

aliceabe pushed a commit to aliceabe/incubator-airflow that referenced this pull request Jan 3, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment