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 · 4 comments
Open

[sdk] Client.get_pipeline_id needs kwargs forwarding #11550

g4s1kk opened this issue Jan 22, 2025 · 4 comments

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

vishalmishra369 commented Jan 24, 2025

/assign

1 similar comment
@KrishBakshi
Copy link

/assign

@KrishBakshi
Copy link

/unassign

@vishalmishra369
Copy link

/assign

how did you do that i am new to open source contributions and wanted to do some
how do you assign it to yourself or can you assign it to me also?

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

3 participants