BigQuery Storage: "400 Request is missing 'x-goog-request-params' header" when using dictionary as table reference #7220
Labels
api: bigquerystorage
Issues related to the BigQuery Storage API.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
I'm unable to create a BigQuery Storage API read session when I use a dictionary instead of a TableReference class as the first argument.
Environment details
General, Core, and Other are also allowed as types
macOS 10.14.3
python --version
pip show google-<service>
orpip freeze
Steps to reproduce
Code example
Stack trace
Suspected culprit
google-cloud-python/bigquery_storage/google/cloud/bigquery_storage_v1beta1/gapic/big_query_storage_client.py
Lines 284 to 287 in 4e8bc85
I believe these are the suspect lines (in the generated code, unfortunately). When
table_reference
is a dictionary,table_reference.project_id
is not accurate. Instead, it would have to betable_reference["project_id"]
. Likewise fordataset_id
.The true fix is probably to have the generator read off the
request
object, since the dict -> protobuf conversion happens in that constructor. That is,request.table_reference.project_id
andrequest.table_reference.dataset_id
instead of reading off thetable_reference
object.The text was updated successfully, but these errors were encountered: