diff --git a/chromadb/ingest/impl/utils.py b/chromadb/ingest/impl/utils.py index 4ad92df6bc3..47c532fa6f7 100644 --- a/chromadb/ingest/impl/utils.py +++ b/chromadb/ingest/impl/utils.py @@ -5,12 +5,16 @@ from chromadb.db.base import SqlDB from chromadb.segment import SegmentManager, VectorReader +_topic_pattern = re.compile( + r"persistent:\/\/(?P.+)\/(?P.+)\/(?P.+)" +) + topic_regex = r"persistent:\/\/(?P.+)\/(?P.+)\/(?P.+)" def parse_topic_name(topic_name: str) -> Tuple[str, str, str]: """Parse the topic name into the tenant, namespace and topic name""" - match = re.match(topic_regex, topic_name) + match = _topic_pattern.match(topic_name) if not match: raise ValueError(f"Invalid topic name: {topic_name}") return match.group("tenant"), match.group("namespace"), match.group("topic")