From b43681b768b8ebdd2ffb1a28bf131bd658f30632 Mon Sep 17 00:00:00 2001 From: Luke Couzens Date: Wed, 24 Apr 2024 12:06:20 +0100 Subject: [PATCH] [COST-4973] - Fix mid month finalization (#5060) --- 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: