# Auto-generated by bolt_pipeliner.generators.airflow — do not edit by hand.
# Standalone Spark entry point for a single ETL job. Edit configs/spark/<profile>.toml
# to change cluster/session settings; this script only depends on bolt_pipeliner.

import sys
import logging
import types

from pyspark.sql import functions as F  # noqa: F401  (imported for user job code)
from pyspark.sql import SparkSession    # noqa: F401

from bolt_pipeliner.sessions import create_session

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger("{job_script_name}")

# The session profile defaults to "local". Override via the BOLT_SPARK_PROFILE
# env var or by editing configs/spark/<profile>.toml in your project.
import os as _os
_profile = _os.environ.get("BOLT_SPARK_PROFILE", "local")
spark = create_session(_profile)

# Bucket roots come from the project's etl_config.yaml at generation time.
output_bucket = "{save_catalog}"
flatfile_bucket = "{flatfile_bucket}"

logger.info("=" * 60)
logger.info("Loading ETLBase")
logger.info("=" * 60)

{etl_base_code}

{code}
