Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BigQuery: SchemaField cannot load resource with missing mode property #4456

Closed
tswast opened this issue Nov 27, 2017 · 0 comments · Fixed by #4754
Closed

BigQuery: SchemaField cannot load resource with missing mode property #4456

tswast opened this issue Nov 27, 2017 · 0 comments · Fixed by #4754
Assignees
Labels
api: bigquery Issues related to the BigQuery API. good first issue This issue is a good place to started contributing to this repository. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@tswast
Copy link
Contributor

tswast commented Nov 27, 2017

The mode property is optional in the REST API, but this code fails:

SchemaField.from_api_repr({'name': 'colname', 'type': 'INT64'})

I believe this is due to the line

mode=api_repr['mode'].upper(),

which does not properly handle when the mode property is missing.

Related to #3723 as it is often convenient to omit the mode parameter when defining a schema file by hand.

@tswast tswast added api: bigquery Issues related to the BigQuery API. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Nov 27, 2017
@tswast tswast self-assigned this Nov 27, 2017
@dhermes dhermes added the good first issue This issue is a good place to started contributing to this repository. label Nov 27, 2017
@chemelnucfin chemelnucfin added the priority: p2 Moderately-important priority. Fix may not be included in next release. label Nov 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the BigQuery API. good first issue This issue is a good place to started contributing to this repository. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants