Skip to content
This repository was archived by the owner on Sep 3, 2022. It is now read-only.

Commit db83a9e

Browse files
authored
Add descriptive message on successful deployment to Composer (#700)
* Add descriptive message on successful deployment to Composer * Add unit-test * Make test error_message more concise
1 parent 3bcda7a commit db83a9e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

google/datalab/bigquery/commands/_bigquery.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,8 @@ def _pipeline_cell(args, cell_body):
939939
try:
940940
airflow = google.datalab.contrib.pipeline.airflow.Airflow(gcs_dag_bucket, gcs_dag_file_path)
941941
airflow.deploy(name, airflow_spec)
942-
error_message += "Pipeline successfully deployed! View Airflow dashboard for more details."
942+
error_message += ("Airflow pipeline successfully deployed! View dashboard for more "
943+
"details.\n")
943944
except AttributeError:
944945
return "Perhaps you're missing: import google.datalab.contrib.pipeline.airflow"
945946

@@ -950,6 +951,8 @@ def _pipeline_cell(args, cell_body):
950951
try:
951952
composer = google.datalab.contrib.pipeline.composer.Composer(location, environment)
952953
composer.deploy(name, airflow_spec)
954+
error_message += ("Composer pipeline successfully deployed! View dashboard for more "
955+
"details.\n")
953956
except AttributeError:
954957
return "Perhaps you're missing: import google.datalab.contrib.pipeline.composer"
955958

tests/bigquery/pipeline_tests.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,8 @@ def test_pipeline_cell_golden(self, mock_bucket_class, mock_get_table, mock_tabl
650650

651651
output = google.datalab.bigquery.commands._bigquery._pipeline_cell(args, cell_body)
652652

653-
error_message = "Pipeline successfully deployed! View Airflow dashboard for more details."
653+
error_message = ("Airflow pipeline successfully deployed! View dashboard for more details.\n"
654+
"Composer pipeline successfully deployed! View dashboard for more details.\n")
654655
airflow_spec_pattern = """
655656
import datetime
656657
from airflow import DAG

0 commit comments

Comments
 (0)