Google-cloud-go: FEATURE: BigQuery InferSchema include field details in error messages

Created on 27 Feb 2019  路  3Comments  路  Source: googleapis/google-cloud-go

The BigQuery InferSchema is a nice convenience function for generating schemas. It would be helpful for debugging purposes if additional details were included in the error being returned including:

  • field name.
  • parent struct name.
  • file.
  • line number.

Line number/file would be nice but not essential.

Some of our structs/schemas have dozens of fields. As a result the current approach for resolving schema errors is either adding 1 field at a time for new schemas or commenting out fields for preexisting structs.

Example Behaviour

Using an unsupported type results in the following error string:

bigquery: unsupported type of field in struct

Desired Behaviour

Some variation like this where Bob is the field and Alice is the parent struct would be ideal:

bigquery: unsupported type of field (Bob) in struct (Alice)
bigquery feature request

Most helpful comment

I'm doing it. It's clearly the right thing and I need a quick win during perf week.

All 3 comments

@shollyman WDYT?

I'm doing it. It's clearly the right thing and I need a quick win during perf week.

Thanks! Haven't had an opportunity to test this yet but looking at the change looks like it should tick the boxes. 馃憤

Was this page helpful?
0 / 5 - 0 ratings