code: def two_columns_to_dictionary(
      df: DataFrame,
      key_col_name: str,
      value_col_name: str,
  ) -> dict[str, Any]:
      """Collect two columns as dictionary when first column is key and second is value.
  
      :param df: Input DataFrame
      :type df: pyspark.sql.DataFrame
      :param key_col_name: Key-column
      :type key_col_name: str
      :param value_col_name: Value-column
      :type value_col_name: str
      :return: Dictionary with values
      :rtype: Dict[str, Any]
      """
      k, v = key_col_name, value_col_name
      return {x[k]: x[v] for x in df.select(k, v).collect()}
  
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 2 for calling a global function with example usage: two_columns_to_dictionary(df, key_col_name, value_col_name) and returns: unknown