Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sdk] Client.get_pipeline_id needs kwargs forwarding #11550

Open
g4s1kk opened this issue Jan 22, 2025 · 1 comment
Open

[sdk] Client.get_pipeline_id needs kwargs forwarding #11550

g4s1kk opened this issue Jan 22, 2025 · 1 comment

Comments

@g4s1kk
Copy link

g4s1kk commented Jan 22, 2025

Environment

  • KFP version:
    2.2.0
  • KFP SDK version:
    2.11.0
  • All dependencies version:
    kfp 2.11.0
    kfp-kubernetes 1.4.0
    kfp-pipeline-spec 0.6.0
    kfp-server-api 2.3.0

Steps to reproduce

client = kfp.Client(host=KUBEFLOW_PIPELINES_ENDPOINT, cookies=auth_session["session_cookie"], ssl_ca_cert=CERT_PATH, namespace=NAMESPACE)

pipeline_filter = json.dumps({
'predicates': [{
'operation': 'EQUALS',
'key': 'display_name',
'stringValue': PIPELINE_NAME,
}]
})

result1 = client.list_pipelines(namespace=NAMESPACE, filter=pipeline_filter)
result2 = client.get_pipeline_id(PIPELINE_NAME)

Expected result

If there is pipeline with PIPELINE_NAME in NAMESPACE, then result2 returns pipeline_id.
But now pipeline_id can be obtained only from result1.

Problems root and the proposed solution

Under the hood both methods use the same pipelines api method but only list_pipelines forwards namespace arg.
The solution is to add **kwargs to get_pipeline_id method definition and forward it to pipeline api method call:

def get_pipeline_id(self, name: str, **kwargs) -> Optional[str]:
...
result = self._pipelines_api.pipeline_service_list_pipelines(filter=pipeline_filter, **kwargs)
...

Then we will be able pass namespace parameter if necessary and obtain correct result.

Materials and Reference

https://kubeflow-pipelines.readthedocs.io/en/sdk-2.11.0/_modules/kfp/client/client.html#Client.get_pipeline_id
https://kubeflow-pipelines.readthedocs.io/en/sdk-2.11.0/_modules/kfp/client/client.html#Client.list_pipelines


Impacted by this bug? Give it a 👍.

@vishalmishra369
Copy link

hey if this problem has not been taken by anyone can i work on it ?
If yes then please do assign it to me !!.

regards,
vishal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants