def METHOD_NAME(event, context):
    session = boto3.Session()
    target_week_date = event["TARGET_DATE"]
    report_dates = get_report_dates_from_target_date(target_week_date)
    print("##")
    print("## -------------------------")
    print("## UPDATING FOR TARGET_DATE (if blank, today):  ", target_week_date)
    print("##")
    print("## report_dates DICT: ", report_dates)
    print("##")
    params = {
        "region": event["REGION"],
        "workgroup": event["WORKGROUP"],
        "database": event["DATABASE"],
        "env": event["ENV"],
        "basename_main": event["BASENAME_MAIN"],
        "basename_per_app": event["BASENAME_PER_APP"],
        "report_dates": report_dates,
        "retry_sleep_seconds": event.get("RETRY_SLEEP_SECONDS", "300")
    }
    lambda_start_time = datetime.datetime.now()
    print("##")
    print("## EVENT: " + str(event))
    print("##")
    print("## Lambda Start Time: ", lambda_start_time)
    print("##")
    # Update/create PER_APP table
    query_start_time = datetime.datetime.now()
    success_flag = update_or_create_metrics_table(
        session, params, params["basename_per_app"], TEMPLATE_FILE_PER_APP
    )
    query_end_time = datetime.datetime.now()
    query_duration_time = query_end_time - query_start_time
    print("## Query Duration Time: ", query_duration_time)
    if success_flag:
        print("## SUCCESS: PER_APP TABLE was updated/created!")
    else:
        print("## FAIL: PER_APP TABLE update/create un-successful after retries!")
        return {
            "STATUS": "FAIL",
            "DETAIL": "PER_APP table create/update was un-successful after retries!",
        }
    # Update/create MAIN table
    query_start_time = datetime.datetime.now()
    success_flag = update_or_create_metrics_table(
        session, params, params["basename_main"], TEMPLATE_FILE_MAIN
    )
    query_end_time = datetime.datetime.now()
    query_duration_time = query_end_time - query_start_time
    print("## Query Duration Time: ", query_duration_time)
    if success_flag:
        print("## SUCCESS: MAIN TABLE was updated/created!")
        lambda_end_time = datetime.datetime.now()
        lambda_duration_time = lambda_end_time - lambda_start_time
        print("##")
        print("## Lambda End Time: ", lambda_end_time)
        print("## Lambda Duration Time: ", lambda_duration_time)
        print("##")
    else:
        print("## FAIL: MAIN TABLE update/create un-successful after retries!")
        return {
            "STATUS": "FAIL",
            "DETAIL": "MAIN table create/update was un-successful after retries!",
        }
    return {
        "STATUS": "SUCCESS",
        "DETAIL": "Metric tables are ready for refresh in QuickSight!",
    }