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

Commit

Permalink
Add descriptive message on successful deployment to Composer (#700)
Browse files Browse the repository at this point in the history
* Add descriptive message on successful deployment to Composer

* Add unit-test

* Make test error_message more concise
  • Loading branch information
rajivpb authored Aug 18, 2018
1 parent 3bcda7a commit db83a9e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion google/datalab/bigquery/commands/_bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,8 @@ def _pipeline_cell(args, cell_body):
try:
airflow = google.datalab.contrib.pipeline.airflow.Airflow(gcs_dag_bucket, gcs_dag_file_path)
airflow.deploy(name, airflow_spec)
error_message += "Pipeline successfully deployed! View Airflow dashboard for more details."
error_message += ("Airflow pipeline successfully deployed! View dashboard for more "
"details.\n")
except AttributeError:
return "Perhaps you're missing: import google.datalab.contrib.pipeline.airflow"

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

Expand Down
3 changes: 2 additions & 1 deletion tests/bigquery/pipeline_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,8 @@ def test_pipeline_cell_golden(self, mock_bucket_class, mock_get_table, mock_tabl

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

error_message = "Pipeline successfully deployed! View Airflow dashboard for more details."
error_message = ("Airflow pipeline successfully deployed! View dashboard for more details.\n"
"Composer pipeline successfully deployed! View dashboard for more details.\n")
airflow_spec_pattern = """
import datetime
from airflow import DAG
Expand Down

0 comments on commit db83a9e

Please sign in to comment.