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

Printing response of Python SDK list_workflows methods returns an error #9770

Closed
2 of 3 tasks
rajaie-sg opened this issue Oct 7, 2022 · 1 comment · Fixed by #9840
Closed
2 of 3 tasks

Printing response of Python SDK list_workflows methods returns an error #9770

rajaie-sg opened this issue Oct 7, 2022 · 1 comment · Fixed by #9840
Assignees

Comments

@rajaie-sg
Copy link

rajaie-sg commented Oct 7, 2022

Pre-requisites

  • I have double-checked my configuration
  • I can confirm the issues exists when I tested with :latest
  • I'd like to contribute the fix myself (see contributing guide)

What happened/what you expected to happen?

I expect to be able to print the response of the list_workflows method in the Python SDK successfully.

import time
import argo_workflows
from argo_workflows.api import workflow_service_api
with argo_workflows.ApiClient(self.configuration) as api_client:
            api_instance = workflow_service_api.WorkflowServiceApi(api_client)
            api_response = api_instance.list_workflows(self._NAMESPACE, _check_return_type=False)
            print(api_response)
  File "/Users/rajaiealkorani/repos/crawl/venv/lib/python3.9/site-packages/argo_workflows/model_utils.py", line 175, in __repr__
    return self.to_str()
  File "/Users/rajaiealkorani/repos/crawl/venv/lib/python3.9/site-packages/argo_workflows/model_utils.py", line 516, in to_str
    return pprint.pformat(self.to_dict())
  File "/Users/rajaiealkorani/repos/crawl/venv/lib/python3.9/site-packages/argo_workflows/model_utils.py", line 512, in to_dict
    return model_to_dict(self, serialize=False)
  File "/Users/rajaiealkorani/repos/crawl/venv/lib/python3.9/site-packages/argo_workflows/model_utils.py", line 1661, in model_to_dict
    res.append(model_to_dict(v, serialize=serialize))
  File "/Users/rajaiealkorani/repos/crawl/venv/lib/python3.9/site-packages/argo_workflows/model_utils.py", line 1633, in model_to_dict
    if model_instance._composed_schemas:
AttributeError: 'dict' object has no attribute '_composed_schemas'

This error doesn't show up if there are 0 workflows.

Version

v6.4.1 of the Python SDK

Paste a small workflow that reproduces the issue. We must be able to run the workflow; don't enter a workflows that uses private images.

the presence of any workflows (running, failed, completed, etc...) causes this issue

Logs from the workflow controller

not relevant

Logs from in your workflow's wait container

not relevant

@rajaie-sg
Copy link
Author

Upon further inspection, it seems the "print(api_response)" is what's causing the error. I am just following the example from https://raw.githubusercontent.com/argoproj/argo-workflows/master/sdks/python/client/docs/WorkflowServiceApi.md

@rajaie-sg rajaie-sg changed the title Python SDK list_workflows break when Workflow in progress Printing response of Python SDK list_workflows methods returns an error Oct 7, 2022
@tczhao tczhao self-assigned this Oct 16, 2022
terrytangyuan pushed a commit that referenced this issue Oct 21, 2022
Signed-off-by: Tianchu Zhao <evantczhao@gmail.com>
juchaosong pushed a commit to juchaosong/argo-workflows that referenced this issue Nov 3, 2022
…roj#9840)

Signed-off-by: Tianchu Zhao <evantczhao@gmail.com>
Signed-off-by: juchao <juchao@coscene.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants