Open mastizada opened 7 months ago
It seems to me that the PATCH /projects/{project]/datasets/{dataset}/tables/{table}
endpoint has numerous problems.
We currently decode the request body into a bigquery.Table
. For example, if we are updating the description, we'd end up with a bigquery.Table
with only the description
set.
The newTable
metadata is then passed along to metadata.Table.Update
, but is unused, resulting in a no-op.
The response for the request handler only contains the contents of r.newTable
, so in this case it'd be only be the description, no other fields.
As an aside, its worth noting that the emulator does not currently support updating a table's schema.
What happened?
When table schema is updated, it calls
BigQuery.updateTable
with PATCH method. With bigquery-emulator, it is returning the updated schema, however,google-cloud-bigquery
plugin expectstableReference
withtableId
in the response. Link to the plugin function.What did you expect to happen?
To have
[tableReference][tableId]
in the response.How can we reproduce it (as minimally and precisely as possible)?
Install the python plugin:
$ pip install google-cloud-bigquery
(tested on latest version, 3.20.1, and old version 2.34.3).Execute the following code:
It will give the following error:
KeyError: 'Resource lacks required identity information:["tableReference"]["tableId"]'
Anything else we need to know?
No response