Skip to content

Commit db72323

Browse files
committed
chore(cli): mark some code as nocover
1 parent 47997fa commit db72323

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/vectorcode/database/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
import logging
2-
from typing import Optional, Type
2+
from typing import Type
33

44
from vectorcode.cli_utils import Config
55
from vectorcode.database.base import DatabaseConnectorBase
66

77
logger = logging.getLogger(name=__name__)
88

99

10-
def get_database_connector(config: Config) -> DatabaseConnectorBase:
10+
def get_database_connector(config: Config) -> DatabaseConnectorBase: # pragma: nocover
1111
"""
1212
It's CRUCIAL to keep the `import`s of the database connectors in the branches.
1313
This allow them to be lazy-imported. This also allow us to keep the main package
1414
lightweight because we don't have to include dependencies for EVERY database.
1515
1616
> Raises a `ValueError` in case the database connector is not supported.
1717
"""
18-
cls: Optional[Type[DatabaseConnectorBase]] = None
18+
cls: Type[DatabaseConnectorBase] | None = None
1919

2020
if not config.db_type.endswith("Connector"):
2121
config.db_type = f"{config.db_type}Connector"

src/vectorcode/database/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ def get_collection_id(full_path: str) -> str:
4848

4949

5050
@cache
51-
def get_embedding_function(configs: Config) -> chromadb.EmbeddingFunction:
51+
def get_embedding_function(
52+
configs: Config,
53+
) -> chromadb.EmbeddingFunction: # pragma: nocover
5254
try:
5355
ef = getattr(embedding_functions, configs.embedding_function)(
5456
**configs.embedding_params

0 commit comments

Comments
 (0)