def METHOD_NAME(jdf, sparkSession: SparkSession) -> DataFrame:
    if hasattr(sparkSession, '_wrapped'):
        # In Spark < 3.3, use the _wrapped SQLContext
        return DataFrame(jdf, sparkSession._wrapped)
    else:
        # In Spark >= 3.3, use the session directly
        return DataFrame(jdf, sparkSession)