def METHOD_NAME(
    self,
    cell,
    input_variable_name,
    var_type,
    output_variable_name,
    max_rows,
    session_name,
):
    try:
        input_variable_value = self.shell.user_ns[input_variable_name]
    except KeyError:
        raise BadUserDataException(
            "Variable named {} not found.".format(input_variable_name)
        )
    if input_variable_value is None:
        raise BadUserDataException(
            "Value of {} is None!".format(input_variable_name)
        )
    if not output_variable_name:
        output_variable_name = input_variable_name
    if not max_rows:
        max_rows = conf.default_maxrows()
    input_variable_type = var_type.lower()
    if input_variable_type == self._STRING_VAR_TYPE:
        command = SendStringToSparkCommand(
            input_variable_name, input_variable_value, output_variable_name
        )
    elif input_variable_type == self._PANDAS_DATAFRAME_VAR_TYPE:
        command = SendPandasDfToSparkCommand(
            input_variable_name,
            input_variable_value,
            output_variable_name,
            max_rows,
        )
    else:
        raise BadUserDataException(
            "Invalid or incorrect -t type. Available are: [{}]".format(
                ",".join(self._ALLOWED_LOCAL_TO_SPARK_TYPES)
            )
        )
    (success, result, mime_type) = self.spark_controller.run_command(command, None)
    if not success:
        self.ipython_display.send_error(result)
    else:
        self.ipython_display.write(
            "Successfully passed '{}' as '{}' to Spark"
            " kernel".format(input_variable_name, output_variable_name)
        )