From 8b753ded1076dee7cbba4550c2f6b878a5713afa Mon Sep 17 00:00:00 2001 From: Taji Harris <98433579+TajiHarrisMicrosoft@users.noreply.github.com> Date: Thu, 6 Jul 2023 10:33:03 -0700 Subject: [PATCH] check that batchrun ins't a pipeline job (#30840) --- sdk/ml/azure-ai-ml/azure/ai/ml/constants/_job/pipeline.py | 1 + sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/constants/_job/pipeline.py b/sdk/ml/azure-ai-ml/azure/ai/ml/constants/_job/pipeline.py index 56aa84dbf324..4b66d401782d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/constants/_job/pipeline.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/constants/_job/pipeline.py @@ -16,6 +16,7 @@ class PipelineConstants: REUSED_FLAG_FIELD = "azureml.isreused" REUSED_FLAG_TRUE = "true" REUSED_JOB_ID = "azureml.reusedrunid" + PIPELINE_JOB_TYPE = "azureml.pipelinejob" class ValidationErrorCode: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py index 2801c33ef332..c7056f40ac26 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py @@ -714,7 +714,10 @@ def download( error_category=ErrorCategory.USER_ERROR, ) - is_batch_job = job_details.tags.get("azureml.batchrun", None) == "true" + is_batch_job = ( + job_details.tags.get("azureml.batchrun", None) == "true" + and job_details.tags.get("azureml.jobtype", None) != PipelineConstants.PIPELINE_JOB_TYPE + ) outputs = {} download_path = Path(download_path) artifact_directory_name = "artifacts"