def setUp(self):
     self.sagemaker = SageMakerTuningOperator(
         task_id='test_sagemaker_operator',
         aws_conn_id='sagemaker_test_conn',
         config=create_tuning_params,
         wait_for_completion=False,
         check_interval=5)
                                 dag=dag,
                                 python_callable=lambda: "model_tuning"
                                 if hpo_enabled else "model_training")

# launch sagemaker training job and wait until it completes
train_model_task = SageMakerTrainingOperator(task_id='model_training',
                                             dag=dag,
                                             config=train_config,
                                             aws_conn_id='airflow-sagemaker',
                                             wait_for_completion=True,
                                             check_interval=30)

# launch sagemaker hyperparameter job and wait until it completes
tune_model_task = SageMakerTuningOperator(task_id='model_tuning',
                                          dag=dag,
                                          config=tuner_config,
                                          aws_conn_id='airflow-sagemaker',
                                          wait_for_completion=True,
                                          check_interval=30)

# launch sagemaker batch transform job and wait until it completes
batch_transform_task = SageMakerTransformOperator(
    task_id='predicting',
    dag=dag,
    config=transform_config,
    aws_conn_id='airflow-sagemaker',
    wait_for_completion=True,
    check_interval=30,
    trigger_rule=TriggerRule.ONE_SUCCESS)

basher_task = BashOperator(task_id='sleep', bash_command='sleep 5', dag=dag)