From 35498f3e74f94c4493ccec321869a81e73a79105 Mon Sep 17 00:00:00 2001 From: HemanthM005 Date: Tue, 12 Nov 2024 18:15:17 +0530 Subject: [PATCH] Fix: date regex correction --- app/utils/column_mapping.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/utils/column_mapping.py b/app/utils/column_mapping.py index cedf571..a619ae4 100644 --- a/app/utils/column_mapping.py +++ b/app/utils/column_mapping.py @@ -61,7 +61,11 @@ async def find_datetime_columns(columns: set): month_pattern = re.compile( r".*({})".format(datetime_settings.MONTH_KEYWORD) ) - date_pattern = re.compile(r".*({})".format(datetime_settings.DATE_KEYWORD)) + date_pattern = re.compile( + r"^.*(?:^|_){}s?(?:_|$)|^.*(?:^|_){}(?:_|$)".format( + datetime_settings.DATE_KEYWORD, datetime_settings.DATE_KEYWORD + ) + ) fiscal_year_columns, columns = extract_pattern_from_columns( columns, non_cal_year_pattern