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

AwsGlueJobOperator: add run_job_kwargs to Glue job run #16796

Merged
merged 2 commits into from
Oct 7, 2021

Conversation

ron-damon
Copy link
Contributor

This PR adds the possibility to set specific Glue job properties for a run instance of an AwsGlueJobOperator without the need to recreate or update the job.
Follows the same approach of the existing create_job_kwargs argument.

This is really useful because you can use the same job with different profiles.

E.g: you can specify a different timeout (Timeout) and size (WorkerType / NumberOfWorkers) for a given table.

# ...
from airflow.providers.amazon.aws.operators.glue import AwsGlueJobOperator
# ...
script_args = {
    "--timestamp": "{{ ts }}",
    "--table": job_table,
}
run_job_kwargs = {
    "Timeout": job_timeout,
    "NumberOfWorkers": job_workers,
    "WorkerType": job_workers_type,
}

upsert_table = AwsGlueJobOperator(
    task_id="upsert_table",
    job_name="upsert-table",
    script_args=script_args,
    run_job_kwargs=run_job_kwargs,
)
# ...

^ 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 boring-cyborg bot added area:providers provider:amazon-aws AWS/Amazon - related issues labels Jul 3, 2021
@boring-cyborg
Copy link

boring-cyborg bot commented Jul 3, 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

@kurtqq
Copy link
Contributor

kurtqq commented Aug 12, 2021

i guess pr is waiting for unit tests?

@github-actions
Copy link

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

@github-actions github-actions bot added the stale Stale PRs per the .github/workflows/stale.yml policy file label Sep 27, 2021
@eladkal eladkal removed the stale Stale PRs per the .github/workflows/stale.yml policy file label Sep 30, 2021
@github-actions
Copy link

github-actions bot commented Oct 1, 2021

The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest main or amend the last commit of the PR, and push it with --force-with-lease.

@github-actions github-actions bot added the okay to merge It's ok to merge this PR as it does not require more tests label Oct 1, 2021
Copy link
Contributor

@ferruzzi ferruzzi left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me.

@eladkal eladkal merged commit 38c6cf9 into apache:main Oct 7, 2021
@boring-cyborg
Copy link

boring-cyborg bot commented Oct 7, 2021

Awesome work, congrats on your first merged pull request!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:providers okay to merge It's ok to merge this PR as it does not require more tests provider:amazon-aws AWS/Amazon - related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants