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

Multiple syntax issues with latest generator release 0.44.0 #848

Closed
parthea opened this issue Apr 27, 2021 · 2 comments · Fixed by #849 or #1133
Closed

Multiple syntax issues with latest generator release 0.44.0 #848

parthea opened this issue Apr 27, 2021 · 2 comments · Fixed by #849 or #1133
Assignees

Comments

@parthea
Copy link
Contributor

parthea commented Apr 27, 2021

There are various PRs opened by owl-bot that are failing for various syntax issues which we believe to be a result of the generator update. I'm going to use this issue to compile a list of the issues that I'm seeing.

For example,
python-area120-tables . See googleapis/python-area120-tables#36
The error is :

2021-04-27T03:52:51.581184531ZStep #5: error: cannot format /workspace/python-area120-tables/google/area120/tables_v1alpha1/types/tables.py: Cannot parse: 637:8: message=struct.Value,

There is a syntax error where there is a comma missing in the arguments for proto.MapField
See here.

class Row(proto.Message):
    r"""A single row in a table.
    Attributes:
        name (str):
            The resource name of the row. Row names have the form
            ``tables/{table}/rows/{row}``. The name is ignored when
            creating a row.
        values (Sequence[google.area120.tables_v1alpha1.types.Row.ValuesEntry]):
            The values of the row. This is a map of
            column key to value. Key is user entered
            name(default) or the internal column id based on
            the view in the request.
    """

    name = proto.Field(
        proto.STRING,
        number=1,
    )
    values = (
        proto.STRING,
        proto.MESSAGE,
        number=2 <---- comma missing here.
        message=struct.Value,
    )

The current client doesn't have a syntax error. See here.

@parthea parthea changed the title Multiple issue with latest generator release 0.44.0 Multiple issues with latest generator release 0.44.0 Apr 27, 2021
@parthea parthea assigned parthea and busunkim96 and unassigned parthea Apr 27, 2021
@parthea parthea changed the title Multiple issues with latest generator release 0.44.0 Multiple syntax issues with latest generator release 0.44.0 Apr 27, 2021
@parthea
Copy link
Contributor Author

parthea commented Apr 27, 2021

python-billing . See googleapis/python-billing#63
The error is

Info
2021-04-27T03:52:07.360775961ZStep #5: error: cannot format /workspace/python-billing/google/cloud/billing_v1/services/cloud_billing/client.py: unindent does not match any outer indentation level (<tokenize>, line 1034)

See
https://github.com/googleapis/python-billing/blob/c4f9cd09da1f3043185093f8bd7d5d8e3a51e1f3/owl-bot-staging/v1/google/cloud/billing_v1/services/cloud_billing/client.py#L1034

         if isinstance(request, dict): <-- this line has a syntax error. There is an extra space in front of the if statement.
            # The request isn't a proto-plus wrapped type,
            # so it must be constructed via keyword expansion.
            request = iam_policy.GetIamPolicyRequest(**request)
        elif not request:
            # Null request, just make one.
            request = iam_policy.GetIamPolicyRequest()
             if resource is not None:
                request.resource = resource

@parthea
Copy link
Contributor Author

parthea commented Apr 27, 2021

python-bigquery-connection . See googleapis/python-bigquery-connection#63
The error is

2021-04-27T03:52:49.693371925ZStep #5: error: cannot format /workspace/python-bigquery-connection/google/cloud/bigquery_connection_v1/services/connection_service/client.py: unindent does not match any outer indentation level (<tokenize>, line 853)

See https://github.com/googleapis/python-bigquery-connection/blob/aed7cf2d0797c86b1eec45aab638fc422d03a1dc/owl-bot-staging/v1/google/cloud/bigquery_connection_v1/services/connection_service/client.py#L853
This looks to be the same issue as python-billing where there is an extra space in front of the if statement.

         if isinstance(request, dict):<-- this line has a syntax error. There is an extra space in front of the if statement.
            # The request isn't a proto-plus wrapped type,
            # so it must be constructed via keyword expansion.
            request = iam_policy.GetIamPolicyRequest(**request)
        elif not request:
            # Null request, just make one.
            request = iam_policy.GetIamPolicyRequest()
             if resource is not None:
                request.resource = resource

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment