Skip to content

Commit

Permalink
minor corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
cbroschinski committed Nov 13, 2024
1 parent ff7ed4f commit 8a3a62f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions python/monetary_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
"values with ',' as decimal mark character)",
}

YEARLY_RE = re.compile("^\d\d\d\d$")
MONTHLY_RE = re.compile("^\d{4}-[0-1]{1}\d$")
DAILY_RE = re.compile("^\d{4}-[0-1]{1}\d-[0-3]{1}\d$")
YEARLY_RE = re.compile(r"^\d\d\d\d$")
MONTHLY_RE = re.compile(r"^\d{4}-[0-1]{1}\d$")
DAILY_RE = re.compile(r"^\d{4}-[0-1]{1}\d-[0-3]{1}\d$")

def get_frequency(date_string):
date_string = date_string.strip()
Expand Down Expand Up @@ -181,7 +181,7 @@ def main():
period = line[args.period_column]
frequency = get_frequency(period)
if frequency is None:
msg = "WARNING: Could not extract a valid date string from period column in line {} ('{}'), skipping..."
msg = "WARNING: Could not extract a valid date string (YYYY, YYYY-MM or YYYY-MM-DD) from period column in line {} ('{}'), skipping..."
oat.print_y(msg.format(line_num, period))
modified_content.append(line)
continue
Expand Down

0 comments on commit 8a3a62f

Please sign in to comment.