Skip to content

Commit

Permalink
fix: type error
Browse files Browse the repository at this point in the history
Signed-off-by: Frost Ming <me@frostming.com>
  • Loading branch information
frostming committed Jan 19, 2024
1 parent de10078 commit 813ef71
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/bentoml/_internal/tag.py
@@ -1,3 +1,5 @@
from __future__ import annotations

import base64
import logging
import re
Expand All @@ -24,11 +26,11 @@


def to_snake_case(name: str) -> str:
def _join(match: re.Match[str]):
def _join(match: re.Match[str]) -> str:
word = match.group()

if len(word) > 1:
return ("_%s_%s" % (word[:-1], word[-1])).lower()
return f"_{word[:-1]}_{word[-1]}".lower()

return "_" + word.lower()

Expand Down

0 comments on commit 813ef71

Please sign in to comment.