Repository navigation
Improve template capabilities of EMR job and step operators - #8572
Merged
Merged
Conversation
|
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/master/CONTRIBUTING.rst)
|
oripwk
force-pushed
the
master
branch
3 times, most recently
from
April 27, 2020 18:40
96875a0 to
de4e8ef
Compare
ashb
reviewed
Apr 27, 2020
Allow EmrCreateJobFlowOperator and EmrAddStepsOperator to receive their 'job_flow_overrides', and 'steps' arguments respectively as Jinja template filenames. This is similar to BashOperator's capability of receiving a filename as its 'bash_command' argument.
ashb
approved these changes
May 1, 2020
|
Awesome work, congrats on your first merged pull request! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
EmrCreateJobFlowOperatorandEmrAddStepsOperatoroperators already support receivingjob_flow_overridesandstepsarguments as templates. However, one of the benefits of templating is the ability to refer to a file, which is not currently supported. A good example of an existing operator which leverages file templates isBashOperator, which applies this principle to its bash_command parameter.Adding such support will improve the usability of the operators greatly, since at the moment the only way to do it is manually invoking Jinja to read the files before passing the arguments to the operators.
This PR simply adds the proper file extensions to
template_extfield, and converts the resulting string into a Python dictionary.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.