Skip to content

Commit

Permalink
Fix Google Spanner example dag (#13842)
Browse files Browse the repository at this point in the history
* Fix Google Spanner example dag

Some tasks requires upstream

Without upstream they want perform operations on resources which does not exist yet

* fixup! Fix Google Spanner example dag
  • Loading branch information
Tobiasz Kędzierski committed Jan 22, 2021
1 parent 3fe8074 commit 9592be8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
GCP_SPANNER_INSTANCE_ID = os.environ.get('GCP_SPANNER_INSTANCE_ID', 'testinstance')
GCP_SPANNER_DATABASE_ID = os.environ.get('GCP_SPANNER_DATABASE_ID', 'testdatabase')
GCP_SPANNER_CONFIG_NAME = os.environ.get(
'GCP_SPANNER_CONFIG_NAME', 'projects/example-project/instanceConfigs/eur3'
'GCP_SPANNER_CONFIG_NAME', f'projects/{GCP_PROJECT_ID}/instanceConfigs/regional-europe-west3'
)
GCP_SPANNER_NODE_COUNT = os.environ.get('GCP_SPANNER_NODE_COUNT', '1')
GCP_SPANNER_DISPLAY_NAME = os.environ.get('GCP_SPANNER_DISPLAY_NAME', 'Test Instance')
Expand Down Expand Up @@ -180,6 +180,8 @@
spanner_instance_create_task
>> spanner_instance_update_task
>> spanner_database_deploy_task
>> spanner_database_deploy_task2
>> spanner_database_update_task
>> spanner_database_update_idempotent1_task
>> spanner_database_update_idempotent2_task
>> spanner_instance_query_task
Expand Down
8 changes: 4 additions & 4 deletions tests/providers/google/cloud/operators/test_spanner_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
import os

import pytest

from airflow.providers.google.cloud.example_dags.example_spanner import (
GCP_PROJECT_ID,
GCP_SPANNER_INSTANCE_ID,
)
from tests.providers.google.cloud.utils.gcp_authenticator import GCP_SPANNER_KEY
from tests.test_utils.gcp_system_helpers import CLOUD_DAG_FOLDER, GoogleSystemTest, provide_gcp_context

GCP_PROJECT_ID = os.environ.get('GCP_PROJECT_ID', 'example-project')
GCP_SPANNER_INSTANCE_ID = os.environ.get('GCP_SPANNER_INSTANCE_ID', 'testinstance')


@pytest.mark.backend("mysql", "postgres")
@pytest.mark.credential_file(GCP_SPANNER_KEY)
Expand Down

0 comments on commit 9592be8

Please sign in to comment.