def add_default_nullable_mode(schema):
    """Manually create the schema objects, adding NULLABLE mode.

    Workaround for error in SchemaField.from_api_repr, which required
    "mode" to be set:
    https://github.com/GoogleCloudPlatform/google-cloud-python/issues/4456
    """
    # Returns a copy rather than modifying the mutable arg,
    # per Issue #277
    result = copy.deepcopy(schema)
    for field in result["fields"]:
        field.setdefault("mode", "NULLABLE")
    return result
Manually create the schema objects, adding NULLABLE mode.

    Workaround for error in SchemaField.from_api_repr, which required
    "mode" to be set:
    https://github.com/GoogleCloudPlatform/google-cloud-python/issues/4456
    
pandas_gbq/schema/__init__.py