code: def describe_with_columns_renamed():
      def it_renames_spaces_to_underscores(spark):
          def spaces_to_underscores(s):
              return s.replace(" ", "_")
  
          schema = StructType(
              [
                  StructField("i like cheese", StringType(), True),
                  StructField("yummy stuff", StringType(), True),
              ]
          )
          data = [("jose", "a"), ("li", "b"), ("sam", "c")]
          source_df = spark.createDataFrame(data, schema)
          actual_df = quinn.with_columns_renamed(spaces_to_underscores)(
              source_df
          )
          expected_df = quinn.create_df(
              spark,
              [("jose", "a"), ("li", "b"), ("sam", "c")],
              [
                  ("i_like_cheese", StringType(), True),
                  ("yummy_stuff", StringType(), True),
              ],
          )
          chispa.assert_df_equality(actual_df, expected_df)
  
      def it_renames_dots_to_underscores(spark):
          def dots_to_underscores(s):
              return s.replace(".", "_")
  
          schema = StructType(
              [
                  StructField("i.like.cheese", StringType(), True),
                  StructField("yummy.stuff", StringType(), True),
              ]
          )
          data = [("jose", "a"), ("li", "b"), ("sam", "c")]
          source_df = spark.createDataFrame(data, schema)
          actual_df = quinn.with_columns_renamed(dots_to_underscores)(
              source_df
          )
          expected_df = quinn.create_df(
              spark,
              [("jose", "a"), ("li", "b"), ("sam", "c")],
              [
                  ("i_like_cheese", StringType(), True),
                  ("yummy_stuff", StringType(), True),
              ],
          )
          chispa.assert_df_equality(actual_df, expected_df)
  
imports: from __future__ import annotations
  import pytest
  import chispa
  import quinn
  from pyspark.sql import DataFrame
  from pyspark.sql.types import StructType, StructField, StringType, IntegerType, ArrayType, MapType
  from quinn.transformations import flatten_struct, flatten_map, flatten_dataframe
  from tests.conftest import auto_inject_fixtures
label_desc: Use image node_id 1 for calling a global function with example usage: describe_with_columns_renamed() and returns: s, s