Ejemplo n.º 1
0
 def test_executes(self, mock_hook):
     mock_instance = mock_hook.return_value
     mock_instance.run_pipeline.return_value = TEST_OPERATION
     operator = LifeSciencesRunPipelineOperator(
         task_id='task-id', body=TEST_BODY, location=TEST_LOCATION, project_id=TEST_PROJECT_ID
     )
     result = operator.execute(None)
     assert result == TEST_OPERATION
Ejemplo n.º 2
0
 def test_executes_without_project_id(self, mock_hook):
     mock_instance = mock_hook.return_value
     mock_instance.run_pipeline.return_value = TEST_OPERATION
     operator = LifeSciencesRunPipelineOperator(
         task_id='task-id',
         body=TEST_BODY,
         location=TEST_LOCATION,
     )
     result = operator.execute(None)
     self.assertEqual(result, TEST_OPERATION)
Ejemplo n.º 3
0
                "machineType": "n1-standard-1",
            },
        },
    }
}
# [END howto_configure_multiple_action_pipeline]

with models.DAG(
        "example_gcp_life_sciences",
        default_args=dict(start_date=dates.days_ago(1)),
        schedule_interval=None,
        tags=['example'],
) as dag:

    # [START howto_run_pipeline]
    simple_life_science_action_pipeline = LifeSciencesRunPipelineOperator(
        task_id='simple-action-pipeline',
        body=SIMPLE_ACTION_PIEPELINE,
        project_id=PROJECT_ID,
        location=LOCATION,
    )
    # [END howto_run_pipeline]

    multiple_life_science_action_pipeline = LifeSciencesRunPipelineOperator(
        task_id='multi-action-pipeline',
        body=MULTI_ACTION_PIPELINE,
        project_id=PROJECT_ID,
        location=LOCATION)

    simple_life_science_action_pipeline >> multiple_life_science_action_pipeline