code: def create_df(
      spark: SparkSession, rows_data, col_specs
  ) -> DataFrame:  # noqa: ANN001
      """Create a new DataFrame from the given data and column specs.
  
      The returned DataFrame s created using the StructType and StructField classes provided by PySpark.
  
      :param spark: SparkSession object
      :type spark: SparkSession
      :param rows_data: the data used to create the DataFrame
      :type rows_data: array-like
      :param col_specs: list of tuples containing the name and type of the field
      :type col_specs: list of tuples
      :return: a new DataFrame
      :rtype: DataFrame
      """
      struct_fields = list(
          map(lambda x: StructField(*x), col_specs)
      )  # noqa: C417
      return spark.createDataFrame(
          data=rows_data, schema=StructType(struct_fields)
      )
  
file_path: quinn/quinn/dataframe_helpers.py
imports: from __future__ import annotations
  from typing import TYPE_CHECKING
  from typing import Any
  from pyspark.sql.types import StructField, StructType
label_desc: Use image node_id 6 for calling a global function with example usage: create_df(spark, rows_data, col_specs) and returns: spark