What are the steps in adding custom labels to a Vertex AI pipeline's `PipelineJobSchedule`?

I would like to know the steps in adding custom labels to a Vertex AI pipeline’s https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform.PipelineJobSchedule|PipelineJobSchedule. Can anyone please provide me with the necessary guidance as it’s not working when I am adding inside the Pipelinejob parameters? :thinking_face:

pipeline_job = aiplatform.PipelineJob(
  template_path="COMPILED_PIPELINE_PATH",
  pipeline_root="PIPELINE_ROOT_PATH",
  display_name="DISPLAY_NAME",
  labels="{"name":"test_xx"}"
)
pipeline_job_schedule = aiplatform.PipelineJobSchedule(
  pipeline_job=pipeline_job,
  display_name="SCHEDULE_NAME"
)

pipeline_job_schedule.create(
  cron="TZ=CRON",
  max_concurrent_run_count=MAX_CONCURRENT_RUN_COUNT,
  max_run_count=MAX_RUN_COUNT,
)```

I might be wrong, I’m not a Vertex guru, but I think you set the label on the Pipeline itself, not the schedule.

Thank you for sharing this information.
I am actually doing it as you can see below but the PipelineJobSchedule overwrites it with only vertex-ai-pipelines-run-billing-id label? :thinking_face:

pipeline_job = aiplatform.PipelineJob(
  template_path="COMPILED_PIPELINE_PATH",
  pipeline_root="PIPELINE_ROOT_PATH",
  display_name="DISPLAY_NAME",
  labels={"name":"test_xx"}  // This line adds label to the Vertex pipeline when creating the pipeline 
)
pipeline_job_schedule = aiplatform.PipelineJobSchedule(
  pipeline_job=pipeline_job,
  display_name="SCHEDULE_NAME"
)

pipeline_job_schedule.create(
  cron="TZ=CRON",
  max_concurrent_run_count=MAX_CONCURRENT_RUN_COUNT,
  max_run_count=MAX_RUN_COUNT,
)```

Have you tried the create schedule method on the job itself, rather than calling the schedule and passing in a job. See this method: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform.PipelineJob#google_cloud_aiplatform_PipelineJob_create_schedule|https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform.PipelineJob#google_cloud_aiplatform_PipelineJob_create_schedule

Yes, I have tried this method, but unfortunately, it did not work for me as well.

There was a bug in the Vertex AI platform SDK which has been discussed in the Github issue ticket below and it has also been fixed in latest SDK versions 1.37.0 (released on December 5th, 2023).

GitHub Issue ticket