Skip to content

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

@tswast

Description

@tswast

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.

Metadata

Metadata

Assignees

Labels

api: bigqueryIssues related to the BigQuery API.good first issueThis issue is a good place to started contributing to this repository.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions