def _config_history_log_dir()

in src/smspark/history_server_utils.py [0:0]


def _config_history_log_dir(event_logs_s3_uri: Optional[str]) -> None:
    if event_logs_s3_uri is not None:
        log.info("s3 path presents, starting history server")

        with open(SPARK_DEFAULTS_CONFIG_PATH, "a") as spark_config:
            print(CONFIG_HISTORY_LOG_DIR_FORMAT.format(event_logs_s3_uri))
            spark_config.write(CONFIG_HISTORY_LOG_DIR_FORMAT.format(event_logs_s3_uri) + "\n")
    else:
        log.info("event_logs_s3_uri does not exist, exiting")
        raise InputError(
            ValueError("spark event logs s3 uri was not specified"), message="Failed to configure history server"
        )