googleapis / googleapis/python-aiplatform
Kubeflow dsl.IfPresentPlaceholder not working properly in Vertex AI pipelines
- Dominant language
- Python
- Stars
- 905
- Forks
- 465
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 44
Description
Hi,
I am using Kubeflow in Vertex AI pipelines. I tried to use the `dsl.IfPresentPlaceholder` to parameterize some input arguments of the @container_component. It looks like the placeholder is not replaced by the actual value at the runtime, which causes the step execution to fail. I would like to know why this behavior is happening. Does Vertex AI support this feature or this is just Kubeflow native?
#### Environment details
- Python version: `3.9`
- `google-cloud-aiplatform` version: `1.59.0`
#### Code example
I am implementing the placeholder in the following way (dummy example):
```python
@dsl.container_component
def hello_someone(optional_name: str = None):
return dsl.ContainerSpec(
image='python:3.9',
command=[
'say_hello',
dsl.IfPresentPlaceholder(
input_name='optional_name', then=['--name', optional_name])
])
```
I design the pipeline, compile, and run it using the `pipeline_jobs.PipelineJob` method.
When I inspect the logs in Vertex Ai I see that the placeholder is not replaced and it is displayed as:
```
{"IfPresent": {"InputName": "optional_name", "Then": ["--name", "null"]}}
```
In this case I don't pass the `optinal_name` argument on the step.
Thanks,
Joāo
Contributor guide
Research direction
Start with the container component example and the compile/run path using pipeline_jobs.PipelineJob; compare the compiled placeholder with the Vertex AI runtime logs shown. Check whether google-cloud-aiplatform 1.59.0 supports dsl.IfPresentPlaceholder in Vertex AI pipelines; done means a confirmed compatibility explanation and a reproducible resolution or documented limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- google-cloud, python
- Domain
- cloud, machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100