I'm trying to create a table at Bigquery through python client. The docs uses `bigquery.SchemaField('name', 'TYPE')` to define a field. Although it doesn't seem to work for **ARRAYS** or **STRUCTS**. This is the ARRAY of STRUCTS field I'm trying to create:

```
bigquery.SchemaField('owners', 'ARRAY<STRUCT<emailAddress STRING, displayName STRING>>', 'REPEATABLE'),

```

If I use the field definition above I get the following API error:

```
400 POST https://www.googleapis.com/bigquery/v2/projects/import-sheet/datasets/sheetgo/tables: Invalid value for: ARRAY<STRUCT<emailAddress STRING, displayName STRING>> is not a valid value

```

The whole code:
---------------

```
schema = [
            bigquery.SchemaField('user', 'STRING'),
            bigquery.SchemaField('id', 'STRING'),
            bigquery.SchemaField('service_origin', 'STRING'),
            bigquery.SchemaField('name', 'STRING'),
            bigquery.SchemaField('mimeType', 'STRING'),
            bigquery.SchemaField('createdAt', 'DATETIME'),
            bigquery.SchemaField('ownedByMe', 'BOOLEAN'),
            bigquery.SchemaField('owners', 'ARRAY<STRUCT<emailAddress STRING, displayName STRING>>', 'REPEATABLE'),
            bigquery.SchemaField('parents', 'ARRAY<STRING>', 'REPEATABLE'),
            bigquery.SchemaField('teamDriveId', 'STRING'),
            bigquery.SchemaField('permissions', 'STRING'),
            bigquery.SchemaField('shared', 'BOOLEAN'),
            bigquery.SchemaField('writersCanShare', 'BOOLEAN'),
            bigquery.SchemaField('sharingUser', 'STRING'),
            bigquery.SchemaField('version', 'STRING'),
            bigquery.SchemaField('size', 'FLOAT'),
            bigquery.SchemaField('data_properties', 'ARRAY<STRUCT<'
                                                        'rows INTEGER,'
                                                        'cells_with_importrange ARRAY<'
                                                                                    'STRUCT<'
                                                                                        'row_index INTEGER,'
                                                                                        'col_index INTEGER,'
                                                                                        'importrange STRING'
                                                                                      '>'
                                                                                    '>,'
                                                        'tab_name STRING,'
                                                        'cell_count FLOAT,'
                                                        'header_rows ARRAY<STRING>,'
                                                    '>>', 'REPEATABLE'),
            bigquery.SchemaField('timezone', 'STRING'),
            bigquery.SchemaField('locale', 'STRING'),
            bigquery.SchemaField('last_scansheet', 'STRING'),
        ]

        bigquery_client = bigquery.Client(PROJECT_ID)
        dataset_ref = bigquery_client.dataset("eita")

        table_ref = dataset_ref.table(table_id)
        table = bigquery.Table(table_ref, schema=schema)

        table = bigquery_client.create_table(table)

```

UPDATE
------

Thanks to [Willian Fuks](https://stackoverflow.com/users/1002277/willian-fuks), I got this working. The end result for the schema ended up like this:

```
schema = [
            bigquery.SchemaField('user', 'STRING'),
            bigquery.SchemaField('id', 'STRING'),
            bigquery.SchemaField('service_origin', 'STRING'),
            bigquery.SchemaField('name', 'STRING'),
            bigquery.SchemaField('mimeType', 'STRING'),
            bigquery.SchemaField('createdAt', 'DATETIME'),
            bigquery.SchemaField('ownedByMe', 'BOOLEAN'),
            bigquery.SchemaField('owners', 'RECORD', mode='REPEATED',
                fields=(
                    bigquery.SchemaField('emailAddress', 'STRING'),
                    bigquery.SchemaField('displayName', 'STRING')
                )
            ),
            bigquery.SchemaField('parents', 'STRING', mode='REPEATED'),
            bigquery.SchemaField('teamDriveId', 'STRING'),
            bigquery.SchemaField('permissions', 'STRING'),
            bigquery.SchemaField('shared', 'BOOLEAN'),
            bigquery.SchemaField('writersCanShare', 'BOOLEAN'),
            bigquery.SchemaField('sharingUser', 'STRING'),
            bigquery.SchemaField('version', 'STRING'),
            bigquery.SchemaField('size', 'FLOAT'),
            bigquery.SchemaField('data_properties', 'RECORD', mode='REPEATED',
                 fields=(
                     bigquery.SchemaField('rows', 'INTEGER'),
                     bigquery.SchemaField('cells_with_importrange', 'RECORD', mode='REPEATED',
                          fields=(
                              bigquery.SchemaField('row_index', 'INTEGER'),
                              bigquery.SchemaField('col_index', 'INTEGER'),
                              bigquery.SchemaField('importrange', 'STRING'),
                          )
                      ),
                     bigquery.SchemaField('tab_name', 'STRING'),
                     bigquery.SchemaField('cell_count', 'FLOAT'),
                     bigquery.SchemaField('header_rows', 'STRING', mode='REPEATED')
                 )
             ),
            bigquery.SchemaField('timezone', 'STRING'),
            bigquery.SchemaField('locale', 'STRING'),
            bigquery.SchemaField('last_scansheet', 'STRING'),
        ]

```