-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cleanup: Upgrade Composer samples to Airflow 2.0 (#5782)
* modify dag_test_utils to point to branch; add airflow 2 changes * upgrade airflow_db_cleanup to Airflow 2.0 * upgrade hadoop tutorial to Airflow 2.0 * upgrade kubernetespodoperator to Airflow 2.0 * upgrade dataproc workflow template to Airflow 2.0 * remove bashoperator python2 example * upgrade DataflowTemplateOperator tutorial to 2.0 * WIP: upgrade bq_notify to Airflow 2 * upgrade bq_copy_across_locations to Airflow 2.0 * upgrade connections to Airflow 2 * more airflow 2.0 migration * db reset update * copy constraints from Airflow * update noxfile config * update constraints to py-3.8 * add pip version override * upgrade simple to airflow 2 * fix lint * bqnotify cleanup * add blog/ conftest * fix license header * more license header fixes * license again * remove unused import from blog conftest * remove unused requirements * remove script used by dag deleted in this PR * Add clarifying comment about email operator * add newline back to csv * fix presumed typo Co-authored-by: Dina Graves Portman <dinagraves@google.com>
- Loading branch information
1 parent
5eecc5e
commit 675e55f
Showing
25 changed files
with
729 additions
and
301 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
composer/blog/gcp-tech-blog/unit-test-dags-cloud-build/conftest.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Copyright 2021 Google LLC | ||
|
||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
|
||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
|
||
import os | ||
|
||
import pytest | ||
|
||
|
||
# this fixture initializes the Airflow DB once per session | ||
# it is used by DAGs in this blog post code only | ||
@pytest.fixture(scope="session") | ||
def airflow_database(): | ||
import airflow.utils.db | ||
|
||
# We use separate directory for local db path per session | ||
# by setting AIRFLOW_HOME env var, which is done in noxfile_config.py. | ||
|
||
assert('AIRFLOW_HOME' in os.environ) | ||
|
||
airflow_home = os.environ["AIRFLOW_HOME"] | ||
airflow_db = f"{airflow_home}/airflow.db" | ||
|
||
# reset both resets and initializes a new database | ||
airflow.utils.db.resetdb(rbac=None) | ||
|
||
# Making sure we are using a data file there. | ||
assert(os.path.isfile(airflow_db)) |
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
Source, Target | ||
nyc-tlc:green.trips_2014,nyc_tlc_EU.trips_2014 | ||
nyc-tlc:green.trips_2015,nyc_tlc_EU.trips_2015 | ||
nyc-tlc.green.trips_2014,nyc_tlc_EU.trips_2014 | ||
nyc-tlc.green.trips_2015,nyc_tlc_EU.trips_2015 |
Oops, something went wrong.