python-docs-samples
python-docs-samples copied to clipboard
WorkflowTemplatePlacement Code Snippet
As on 13-Jun-2022, the WorkflowTemplatePlacement documentation seems to be providing incorrect key names that can be misleading. A code snippet showcasing the right way to leverage these APIs can be helpful for many. I have a ready snippet that I wrote to demonstrate the usage that I would like to contribute back to the repo.
Hi Jerome, please send a pull request and our team will review it.
Hey @datasherlock, can you help provide more information?
- What documentation are you referring to? Can you provide any links?
- Is the issue you're having, from any of the files in this repository? If so, could you provide the links to those files?
Hi Dan, I'm referring to the sample at https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.locations.workflowTemplates#workflowtemplateplacement. The JSON templates provided on this page seem to be incorrect. What actually worked was
"cluster_selector": {
"zone": "us-central1-a",
"cluster_labels": {string: string}
}
And this is the PR I submitted - https://github.com/googleapis/python-dataproc/pull/440
It's a proto documentation which is not this repository's purview. If there is an issue with it, please file a bug with the dataproc proto team responsible.
With regards to cluster_selector
: it seems to me it's working as intended; the client library expects cluster_selector
as shown here in the Python docs: https://cloud.google.com/python/docs/reference/dataproc/latest/google.cloud.dataproc_v1.types.WorkflowTemplatePlacement. The link to your doc is for the REST API, which may not work as intended.
Your sample seems to overlap the content from https://github.com/googleapis/python-dataproc/blob/main/samples/generated_samples/dataproc_v1_generated_workflow_template_service_instantiate_inline_workflow_template_sync.py. But, if the repo maintainer is happy to accept the sample after a bit more work has been put into it, that should be a good addition :)