code: def bigquery_field_to_ibis_dtype(field):
      
      typ = field.field_type
      if typ == 'RECORD':
          fields = field.fields
          assert fields, 'RECORD fields are empty'
          names = [el.name for el in fields]
          ibis_types = list(map(dt.dtype, fields))
          ibis_type = dt.Struct(names, ibis_types)
      else:
          ibis_type = _LEGACY_TO_STANDARD.get(typ, typ)
          ibis_type = _DTYPE_TO_IBIS_TYPE.get(ibis_type, ibis_type)
      if field.mode == 'REPEATED':
          ibis_type = dt.Array(ibis_type)
      return ibis_type
docs: Convert BigQuery `field` to an ibis type.