nerdexam
Microsoft

DP-100 · Question #250

You have a Python script that executes a pipeline. The script includes the following code: from azureml.core import Experiment pipeline_run = Experiment(ws, 'pipeline_test').submit(pipeline) You…

The correct answer is B. pipeline_run.wait_for_completion(show_output=True). The correct answer is B: pipeline_run.wait_for_completion(show_output=True). After submitting a pipeline run with Experiment.submit(), the call returns immediately without blocking. To display the STDOUT output when the pipeline completes, you must call…

Explore data and run experiments

Question

You have a Python script that executes a pipeline. The script includes the following code: from azureml.core import Experiment pipeline_run = Experiment(ws, 'pipeline_test').submit(pipeline) You want to test the pipeline before deploying the script. You need to display the pipeline run details written to the STDOUT output when the pipeline completes. Which code segment should you add to the test script?

Options

  • Apipeline_run.get.metrics()
  • Bpipeline_run.wait_for_completion(show_output=True)
  • Cpipeline_param = PipelineParameter(name="stdout",
  • Dpipeline_run.get_status()

How the community answered

(37 responses)
  • A
    3% (1)
  • B
    86% (32)
  • C
    8% (3)
  • D
    3% (1)

Explanation

The correct answer is B: pipeline_run.wait_for_completion(show_output=True). After submitting a pipeline run with Experiment.submit(), the call returns immediately without blocking. To display the STDOUT output when the pipeline completes, you must call wait_for_completion(show_output=True), which blocks execution until the run finishes and streams the output logs to the console. Option A has incorrect syntax (get.metrics() should be get_metrics()). Option C creates a PipelineParameter, which is unrelated to displaying output. Option D (get_status()) only retrieves the current run status string without waiting or displaying logs.

Topics

#Azure ML Pipelines#Pipeline Monitoring#Python SDK#Run Management

Community Discussion

No community discussion yet for this question.

Full DP-100 Practice