code: def to_arrow_schema(schema):
      
      import pyarrow as pa
      fields = [pa.field(field.name, to_arrow_type(field.dataType), nullable=field.nullable)
                for field in schema]
      return pa.schema(fields)
docs: Convert a schema from Spark to Arrow