From 813ef718a47036eaddb228c6869173a239da87af Mon Sep 17 00:00:00 2001 From: Frost Ming Date: Fri, 19 Jan 2024 17:53:05 +0800 Subject: [PATCH] fix: type error Signed-off-by: Frost Ming --- src/bentoml/_internal/tag.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/bentoml/_internal/tag.py b/src/bentoml/_internal/tag.py index 0ecf690e859..faf23c125bb 100644 --- a/src/bentoml/_internal/tag.py +++ b/src/bentoml/_internal/tag.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import base64 import logging import re @@ -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()