Skip to content

Commit

Permalink
fix define_schema for arrays of records
Browse files Browse the repository at this point in the history
  • Loading branch information
nickymikail committed Oct 24, 2018
1 parent 7923e29 commit a38c75d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions target_bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,16 @@ def define_schema(field, name):
schema_type = field['type'][1]
else:
schema_type = field['type']
if schema_type == "array":
schema_type = field.get('items').get('type')
schema_mode = "REPEATED"
if schema_type == "object":
schema_type = "RECORD"
schema_fields = tuple(build_schema(field))
if schema_type == "array":
schema_type = field.get('items').get('type')
schema_mode = "REPEATED"
if schema_type == "object":
schema_type = "RECORD"
schema_fields = tuple(build_schema(field.get('items')))


if schema_type == "string":
if "format" in field:
Expand Down

0 comments on commit a38c75d

Please sign in to comment.