Skip to content

Commit

Permalink
docs: Add additional args to avoid type checks. Fixes #7293 (#7500)
Browse files Browse the repository at this point in the history
Signed-off-by: Yuan Tang <[email protected]>
  • Loading branch information
terrytangyuan authored Jan 6, 2022
1 parent 4b006d5 commit e0f43b8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions sdks/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)

```
Expand Down
2 changes: 1 addition & 1 deletion sdks/python/examples/hello-world-from-object.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion sdks/python/examples/hello-world-from-raw-yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit e0f43b8

Please sign in to comment.