From 409baf892bc38a8d227eca7a1dc3599a2faf2149 Mon Sep 17 00:00:00 2001 From: Luke Couzens Date: Tue, 23 Apr 2024 14:15:03 +0100 Subject: [PATCH] [COST-4973] - Fix mid month finalization --- koku/masu/external/downloader/aws/aws_report_downloader.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/koku/masu/external/downloader/aws/aws_report_downloader.py b/koku/masu/external/downloader/aws/aws_report_downloader.py index c581395667..f5a261ad5e 100644 --- a/koku/masu/external/downloader/aws/aws_report_downloader.py +++ b/koku/masu/external/downloader/aws/aws_report_downloader.py @@ -70,7 +70,9 @@ def get_processing_date( base_cols = copy.deepcopy(utils.RECOMMENDED_ALT_COLUMNS) | copy.deepcopy(utils.OPTIONAL_ALT_COLS) data_frame = pd.read_csv(local_file, usecols=[invoice_bill], nrows=1) use_cols = com_utils.fetch_optional_columns(local_file, base_cols, optional_cols, tracing_id, context) - if data_frame[invoice_bill].any() or not check_provider_setup_complete(provider_uuid): + if ( + data_frame[invoice_bill].any() and start_date.month != DateHelper().now_utc.month + ) or not check_provider_setup_complete(provider_uuid): ReportManifestDBAccessor().mark_s3_parquet_to_be_cleared(manifest_id) process_date = ReportManifestDBAccessor().set_manifest_daily_start_date(manifest_id, start_date) else: