Skip to content

Commit

Permalink
apply suggestions from PR review: simplify regexp
Browse files Browse the repository at this point in the history
Co-authored-by: Helio Machado <[email protected]>
  • Loading branch information
shcheklein and 0x2b3bfa0 authored Oct 28, 2024
1 parent ba5dd56 commit cd76ebe
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/datachain/lib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ def normalize_col_names(col_names: Sequence[str]) -> dict[str, str]:

for org_column in col_names:
new_column = org_column.lower()
new_column = re.sub("[^0-9a-z_\\s-]+", "_", new_column)
new_column = re.sub("[-_\\s]+", "_", new_column)
new_column = re.sub("[^0-9a-z]+", "_", new_column)
new_column = new_column.strip("_")

if (
Expand Down

0 comments on commit cd76ebe

Please sign in to comment.