Skip to content

Commit

Permalink
Make regular expression into raw string (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
jlopezpena authored Apr 11, 2024
1 parent e32b0a7 commit f6f85ba
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nbs/validation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@
" # try to catch pandas frequency in polars dataframe\n",
" if isinstance(times, pl_Series) and isinstance(freq, str):\n",
" missing_n = re.search(r\"\\d+\", freq) is None\n",
" uppercase = re.sub(\"\\d+\", \"\", freq).isupper()\n",
" uppercase = re.sub(r\"\\d+\", \"\", freq).isupper()\n",
" if missing_n or uppercase:\n",
" raise ValueError(\n",
" \"You must specify a valid polars offset when using polars dataframes. \"\n",
Expand Down
2 changes: 1 addition & 1 deletion utilsforecast/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def validate_freq(
# try to catch pandas frequency in polars dataframe
if isinstance(times, pl_Series) and isinstance(freq, str):
missing_n = re.search(r"\d+", freq) is None
uppercase = re.sub("\d+", "", freq).isupper()
uppercase = re.sub(r"\d+", "", freq).isupper()
if missing_n or uppercase:
raise ValueError(
"You must specify a valid polars offset when using polars dataframes. "
Expand Down

0 comments on commit f6f85ba

Please sign in to comment.