From e0f43b8a5a97579040f00f936be29592542b2a07 Mon Sep 17 00:00:00 2001 From: Yuan Tang Date: Thu, 6 Jan 2022 16:52:58 -0500 Subject: [PATCH] docs: Add additional args to avoid type checks. Fixes #7293 (#7500) Signed-off-by: Yuan Tang --- sdks/python/README.md | 6 +++--- sdks/python/examples/hello-world-from-object.py | 2 +- sdks/python/examples/hello-world-from-raw-yaml.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sdks/python/README.md b/sdks/python/README.md index c01efecc371f..31283e1b35a2 100644 --- a/sdks/python/README.md +++ b/sdks/python/README.md @@ -39,12 +39,12 @@ api_client = argo_workflows.ApiClient(configuration) api_instance = workflow_service_api.WorkflowServiceApi(api_client) api_response = api_instance.create_workflow( namespace="argo", - body=IoArgoprojWorkflowV1alpha1WorkflowCreateRequest(workflow=manifest)) + body=IoArgoprojWorkflowV1alpha1WorkflowCreateRequest(workflow=manifest, _check_return_type=False, _check_type=False)) pprint(api_response) ``` -Note that `_check_type=False` is required here to avoid type checks against `manifest` which is a Python dictionary. +Note that `_check_type=False` is required here to avoid type checks against `manifest` which is a Python dictionary and `_check_return_type=False` avoids [an existing issue](https://github.com/argoproj/argo-workflows/issues/7293) with OpenAPI generator. Alternative, you can submit a workflow with an instance of `IoArgoprojWorkflowV1alpha1Workflow` constructed via the SDK like the following: @@ -82,7 +82,7 @@ api_instance = workflow_service_api.WorkflowServiceApi(api_client) if __name__ == '__main__': api_response = api_instance.create_workflow( namespace='argo', - body=IoArgoprojWorkflowV1alpha1WorkflowCreateRequest(workflow=manifest)) + body=IoArgoprojWorkflowV1alpha1WorkflowCreateRequest(workflow=manifest, _check_return_type=False)) pprint(api_response) ``` diff --git a/sdks/python/examples/hello-world-from-object.py b/sdks/python/examples/hello-world-from-object.py index f36aea2e1a5c..b8c90713954c 100644 --- a/sdks/python/examples/hello-world-from-object.py +++ b/sdks/python/examples/hello-world-from-object.py @@ -28,5 +28,5 @@ api_instance = workflow_service_api.WorkflowServiceApi(api_client=api_client) api_response = api_instance.create_workflow( namespace='argo', - body=IoArgoprojWorkflowV1alpha1WorkflowCreateRequest(workflow=manifest)) + body=IoArgoprojWorkflowV1alpha1WorkflowCreateRequest(workflow=manifest, _check_return_type=False)) pprint(api_response) diff --git a/sdks/python/examples/hello-world-from-raw-yaml.py b/sdks/python/examples/hello-world-from-raw-yaml.py index 8e5cb6cfe283..353033c7c57f 100644 --- a/sdks/python/examples/hello-world-from-raw-yaml.py +++ b/sdks/python/examples/hello-world-from-raw-yaml.py @@ -17,5 +17,5 @@ api_instance = workflow_service_api.WorkflowServiceApi(api_client) api_response = api_instance.create_workflow( namespace='argo', - body=IoArgoprojWorkflowV1alpha1WorkflowCreateRequest(workflow=manifest)) + body=IoArgoprojWorkflowV1alpha1WorkflowCreateRequest(workflow=manifest, _check_return_type=False, _check_type=False)) pprint(api_response)