Skip to content

Commit

Permalink
Add sanitize_metric_name
Browse files Browse the repository at this point in the history
  • Loading branch information
idrissneumann committed Sep 11, 2024
1 parent 894e589 commit 09890d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,6 @@ def is_uuid (var):
def is_not_uuid (var):
return not is_uuid(var)

_allowed_chars_pattern = re.compile(r'[^a-zA-Z0-9_\-\.]')
_allowed_chars_metric_pattern = re.compile(r'[^a-zA-Z0-9]')
def sanitize_metric_name(name: str):
return re.sub(_allowed_chars_pattern, '_', name)
return re.sub(_allowed_chars_metric_pattern, '_', name)

0 comments on commit 09890d7

Please sign in to comment.