def convert_cerberus_schema_to_pyspark(schema: Mapping[(str, Any)]) -> StructType:
    '\n    Convert a cerberus validation schema to a pyspark schema.\n\n    Assumes that schema is not nested.\n    The following are required in spark schema:\n    * `nullable` is False by default\n    * `metadata` is an empty dict by default\n    * `name` is the name of the field\n    '
    fields = [{'metadata': {}, 'name': name, 'nullable': True, **values} for (name, values) in schema.items() if isinstance(values, dict)]
    return StructType.fromJson({'fields': fields, 'type': 'struct'})
Convert a cerberus validation schema to a pyspark schema.

Assumes that schema is not nested.
The following are required in spark schema:
* `nullable` is False by default
* `metadata` is an empty dict by default
* `name` is the name of the field
def convert_cerberus_schema_to_pyspark(schema: Mapping[(str, Any)]) -> StructType:
    '\n    Convert a cerberus validation schema to a pyspark schema.\n\n    Assumes that schema is not nested.\n    The following are required in spark schema:\n    * `nullable` is False by default\n    * `metadata` is an empty dict by default\n    * `name` is the name of the field\n    '
    fields = [{'metadata': {}, 'name': name, 'nullable': True, **values} for (name, values) in schema.items() if isinstance(values, dict)]
    return StructType.fromJson({'fields': fields, 'type': 'struct'})