Skip to content

Commit 3aae799

Browse files
fix: handle repeated fields in method signatures (#445)
Co-authored-by: Dov Shlachter <[email protected]>
1 parent 8b2a5ab commit 3aae799

File tree

1 file changed

+2
-2
lines changed
  • gapic/templates/%namespace/%name_%version/%sub/services/%service

1 file changed

+2
-2
lines changed

gapic/templates/%namespace/%name_%version/%sub/services/%service/client.py.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,12 +338,12 @@ class {{ service.client_name }}(metaclass={{ service.client_name }}Meta):
338338
# If we have keyword arguments corresponding to fields on the
339339
# request, apply these.
340340
{% endif -%}
341-
{%- for key, field in method.flattened_fields.items() if not(field.repeated and method.input.ident.package != method.ident.package) %}
341+
{%- for key, field in method.flattened_fields.items() if not(field.repeated or method.input.ident.package != method.ident.package) %}
342342
if {{ field.name }} is not None:
343343
request.{{ key }} = {{ field.name }}
344344
{%- endfor %}
345345
{# They can be _extended_, however -#}
346-
{%- for key, field in method.flattened_fields.items() if (field.repeated and method.input.ident.package != method.ident.package) %}
346+
{%- for key, field in method.flattened_fields.items() if field.repeated %}
347347
if {{ field.name }}:
348348
request.{{ key }}.extend({{ field.name }})
349349
{%- endfor %}

0 commit comments

Comments
 (0)