in 5. MLOps SageMaker Project/sagemaker-workshop-build-seedcode-v1/pipelines/train/pipeline.py [0:0]
def get_pipeline_custom_tags(new_tags, region, sagemaker_project_arn=None):
try:
sm_client = get_sagemaker_client(region)
response = sm_client.list_tags(
ResourceArn=sagemaker_project_arn)
project_tags = response["Tags"]
for project_tag in project_tags:
new_tags.append(project_tag)
except Exception as e:
print(f"Error getting project tags: {e}")
return new_tags