Skip to content

Commit e87bc46

Browse files
handle keyerror if key not present by passing default value (Azure#40975)
1 parent 9194780 commit e87bc46

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@
6262
TID_FMT,
6363
AssetTypes,
6464
AzureMLResourceType,
65+
GitProperties,
6566
WorkspaceDiscoveryUrlKey,
6667
)
6768
from azure.ai.ml.constants._compute import ComputeType
68-
from azure.ai.ml.constants._common import GitProperties
6969
from azure.ai.ml.constants._job.pipeline import PipelineConstants
7070
from azure.ai.ml.entities import Compute, Job, PipelineJob, ServiceInstance, ValidationResult
7171
from azure.ai.ml.entities._assets._artifacts.code import Code
@@ -690,10 +690,10 @@ def create_or_update(
690690
repo_url = git_props.get(GitProperties.PROP_MLFLOW_GIT_REPO_URL)
691691

692692
if has_pat_token(repo_url):
693-
git_props.pop(GitProperties.PROP_MLFLOW_GIT_REPO_URL)
694-
git_props.pop(GitProperties.PROP_MLFLOW_GIT_BRANCH)
695-
git_props.pop(GitProperties.PROP_MLFLOW_GIT_COMMIT)
696-
git_props.pop(GitProperties.PROP_DIRTY)
693+
git_props.pop(GitProperties.PROP_MLFLOW_GIT_REPO_URL, None)
694+
git_props.pop(GitProperties.PROP_MLFLOW_GIT_BRANCH, None)
695+
git_props.pop(GitProperties.PROP_MLFLOW_GIT_COMMIT, None)
696+
git_props.pop(GitProperties.PROP_DIRTY, None)
697697
module_logger.warning("Git properties are removed because the repository URL contains a secret.")
698698

699699
if git_props:

0 commit comments

Comments
 (0)