gapic-generator-python icon indicating copy to clipboard operation
gapic-generator-python copied to clipboard

Type field mistakenly called as `type_` in generated unit tests

Open vam-google opened this issue 2 years ago • 0 comments

When generating logging python client (https://github.com/googleapis/googleapis/blob/master/google/logging/v2/BUILD.bazel#L191), the generated unit tests fails with:

            response = await client.write_log_entries(
                log_name='log_name_value',
>               resource=monitored_resource_pb2.MonitoredResource(type_='type__value'),
                labels={'key_value': 'value_value'},
                entries=[log_entry.LogEntry(log_name='log_name_value')],
            )
E           ValueError: Protocol message MonitoredResource has no "type_" field.

This is currently being fixed by owlbot.py post-processing logic https://github.com/googleapis/python-logging/blob/main/owlbot.py#L29 but should be fixed in the generator itself

vam-google avatar Jul 20 '22 01:07 vam-google