googleapis / python-bigquery

Apache License 2.0
746 stars 306 forks source link

ArrayQueryParameter.from_api_repr does not support empty array #2009

Open TommyDew42 opened 2 months ago

TommyDew42 commented 2 months ago

The ArrayQueryParameter class must take a StructQueryParameterType if the values is an empty array (docstring):

If the type is 'STRUCT'/'RECORD' and values is empty, the exact item type cannot be deduced, thus a StructQueryParameterType instance needs to be passed in.

But in the method _from_api_repr_struct, we simply pass "STRUCT" as the array_type.