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

feat!: Adds support for Airflow 2 Cloud Composer environment and operators #134

Merged
merged 8 commits into from Aug 10, 2021

Conversation

adlersantos
Copy link
Member

@adlersantos adlersantos commented Aug 9, 2021

Description

This PR is the last to be merged in a series of breaking pull requests that upgrades the architecture to Airflow 2:

Changes

First, DAGs are now generated using Airflow 2.0+ operators by specifying an airflow_version: 2 in the dag block of the YAML config

# pipeline.yaml

dag:
  airflow_version: 2

  # .. more DAG config

For backwards compatibility, pipelines default to using Airflow 1.10 operators if airflow_version is unspecified (tested it with the usa_names dataset in #136.

Next, we can now import Airflow 2.x equivalents of commonly used Airflow 1.10.15 operators.

Next, because Airflow 1.10 DAGs can run in an Airflow 2.x environment, but not the other way around, I added some version compatibility checks when deploying a DAG.

Finally, I revised deploy_dag to use the new Airflow 2 CLI:

# old cli
$ airflow variables --import 

# new cli
$ airflow variables import

Checklist

Note: Delete items below that aren't applicable to your pull request.

  • Please merge this PR for me once it is approved.
  • If this PR adds or edits a feature, I have updated the README accordingly.
  • This PR is appropriately labeled.

@google-cla google-cla bot added the cla: yes label Aug 9, 2021
@adlersantos adlersantos added cleanup Cleanup or refactor code feature request New feature or request revision: readme Improvements or additions to the README labels Aug 9, 2021
samples/pipeline.yaml Show resolved Hide resolved
scripts/deploy_dag.py Outdated Show resolved Hide resolved
scripts/generate_dag.py Outdated Show resolved Hide resolved
* revised dependendices for Airflow 2.1.1

* use proper variables file as required by Airflow 2

* changed README to use Airflow 2 requirement

* uncommented deploy_dag_versioning check

* feat: Upgrade `usa_names` pipeline to usse Airflow 2 operators and environment (#136)
@leahecole leahecole merged commit b2749c6 into main Aug 10, 2021
@leahecole leahecole deleted the airflow2-gcloud branch August 10, 2021 22:02
@release-please release-please bot mentioned this pull request Aug 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes cleanup Cleanup or refactor code feature request New feature or request revision: readme Improvements or additions to the README
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants