code: def test_flatten_dataframe(spark):
      # Define input data
      data = [
          (
              1,
              "John",
              {
                  "age": 30,
                  "gender": "M",
                  "address": {"city": "New York", "state": "NY"},
              },
          ),
          (
              2,
              "Jane",
              {
                  "age": 25,
                  "gender": "F",
                  "address": {"city": "San Francisco", "state": "CA"},
              },
          ),
      ]
      schema = StructType(
          [
              StructField("id", IntegerType(), True),
              StructField("name", StringType(), True),
              StructField(
                  "details",
                  StructType(
                      [
                          StructField("age", IntegerType(), True),
                          StructField("gender", StringType(), True),
                          StructField(
                              "address",
                              StructType(
                                  [
                                      StructField(
                                          "city", StringType(), True
                                      ),
                                      StructField(
                                          "state", StringType(), True
                                      ),
                                  ]
                              ),
                              True,
                          ),
                      ]
                  ),
                  True,
              ),
          ]
      )
      df = spark.createDataFrame(data, schema)
      expected_data = [
          (1, "John", 30, "M", "New York", "NY"),
          (2, "Jane", 25, "F", "San Francisco", "CA"),
      ]
      expected_schema = StructType(
          [
              StructField("id", IntegerType(), True),
              StructField("name", StringType(), True),
              StructField("details:age", IntegerType(), True),
              StructField("details:gender", StringType(), True),
              StructField("details:address:city", StringType(), True),
              StructField("details:address:state", StringType(), True),
          ]
      )
      expected_df = spark.createDataFrame(
          expected_data, expected_schema
      )
      result_df = flatten_dataframe(df)
      chispa.assert_df_equality(result_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 27 for calling a global function with example usage: test_flatten_dataframe(spark) without return types