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

metadata.json from "Using Flex Templates" docs results in syntax error on build #4623

Closed
tjwebb opened this issue Sep 3, 2020 · 2 comments · Fixed by #4658
Closed

metadata.json from "Using Flex Templates" docs results in syntax error on build #4623

tjwebb opened this issue Sep 3, 2020 · 2 comments · Fixed by #4658
Assignees
Labels
api: dataflow Issues related to the Dataflow API. samples Issues that are directly related to samples. type: question Request for information or clarification. Not an issue.

Comments

@tjwebb
Copy link
Member

tjwebb commented Sep 3, 2020

In which file did you encounter the issue?

https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/dataflow/flex-templates/streaming_beam/metadata.json

Did you change the file? If so, how?

git diff metadata.json
diff --git a/dataflow/flex-templates/streaming_beam/metadata.json b/dataflow/flex-templates/streaming_beam/metadata.json
index 029a505d..7dfb3242 100644
--- a/dataflow/flex-templates/streaming_beam/metadata.json
+++ b/dataflow/flex-templates/streaming_beam/metadata.json
@@ -5,7 +5,7 @@
     {
       "name": "input_subscription",
       "label": "Input PubSub subscription.",
-      "help_text": "Name of the input PubSub subscription to consume from.",
+      "helpText": "Name of the input PubSub subscription to consume from.",
       "regexes": [
         "[a-zA-Z][-_.~+%a-zA-Z0-9]{2,}"
       ]
@@ -13,7 +13,7 @@
     {
       "name": "output_table",
       "label": "BigQuery output table name.",
-      "help_text": "Name of the BigQuery output table name.",
+      "helpText": "Name of the BigQuery output table name.",
       "is_optional": true,
       "regexes": [
         "[^:]+:[^.]+[.].+"

Describe the issue

Following docs: https://cloud.google.com/dataflow/docs/guides/templates/using-flex-templates#running_a_flex_template_pipeline

results in this error using the provided metadata.json (linked above):

gcloud beta dataflow flex-template build $TEMPLATE_PATH \
>     --image "$TEMPLATE_IMAGE" \
>     --sdk-language "PYTHON" \
{
>     --metadata-file "metadata.json"
ERROR: gcloud crashed (ValueError): Invalid template metadata. Parameter helpText field is empty. Parameter: <ParameterMetadata
 label: 'Input PubSub subscription.'
 name: 'input_subscription'
{
 regexes: ['[a-zA-Z][-_.~+%a-zA-Z0-9]{2,}']>
@product-auto-label product-auto-label bot added the samples Issues that are directly related to samples. label Sep 3, 2020
@yoshi-automation yoshi-automation added triage me I really want to be triaged. 🚨 This issue needs some love. labels Sep 3, 2020
@tmatsuo tmatsuo added api: dataflow Issues related to the Dataflow API. type: question Request for information or clarification. Not an issue. labels Sep 8, 2020
@tmatsuo tmatsuo added the blunderbuss: assign Instruct blunderbuss to assign someone label Sep 8, 2020
@blunderbuss-gcf blunderbuss-gcf bot removed the blunderbuss: assign Instruct blunderbuss to assign someone label Sep 8, 2020
@tmatsuo tmatsuo assigned davidcavazos and unassigned crwilcox Sep 8, 2020
@tmatsuo tmatsuo removed 🚨 This issue needs some love. triage me I really want to be triaged. labels Sep 8, 2020
@davidcavazos
Copy link
Contributor

Hi @arvindram03, is the helpText parameter only supported in camelCase? If so, can we support snake_case as well for Python metadata files?

@davidcavazos
Copy link
Contributor

Thank you for filing this, the fix has been merged :)

Apparently, only camelCase was supported for the metadata file, so we've updated the docs and code samples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: dataflow Issues related to the Dataflow API. samples Issues that are directly related to samples. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants