Skip to content

Commit c10fcc9

Browse files
are-cesclaude
andcommitted
LCORE-1426: fix test and linter issues from review feedback
- Replace assert with runtime ValueError for bandit compliance - Fix backend="rag" → backend="faiss" in test helper - Add pylint disable for no-member on Pydantic model validator Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1123cdb commit c10fcc9

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

src/llama_stack_configuration.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@
2222
# "pgvector": "remote::pgvector", # TODO(are-ces): add enrichment support
2323
}
2424

25-
assert constants.DEFAULT_RAG_BACKEND in BACKEND_TO_LLAMA_STACK_PROVIDER, (
26-
f"DEFAULT_RAG_BACKEND '{constants.DEFAULT_RAG_BACKEND}' has no entry in "
27-
f"BACKEND_TO_LLAMA_STACK_PROVIDER — add a mapping before changing the default."
28-
)
25+
if constants.DEFAULT_RAG_BACKEND not in BACKEND_TO_LLAMA_STACK_PROVIDER:
26+
raise ValueError(
27+
f"DEFAULT_RAG_BACKEND '{constants.DEFAULT_RAG_BACKEND}' has no entry in "
28+
f"BACKEND_TO_LLAMA_STACK_PROVIDER — add a mapping before changing the default."
29+
)
2930

3031

3132
class YamlDumper(yaml.Dumper): # pylint: disable=too-many-ancestors

src/models/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2066,6 +2066,7 @@ class RagConfiguration(ConfigurationBase):
20662066
@model_validator(mode="after")
20672067
def validate_retrieval_sources(self) -> Self:
20682068
"""Reject retrieval source IDs not declared in byok.stores or OKP."""
2069+
# pylint: disable=no-member
20692070
known_ids = {store.rag_id for store in self.byok.stores}
20702071
known_ids.add(constants.OKP_RAG_ID)
20712072

tests/unit/utils/test_responses.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1712,7 +1712,7 @@ def _make_byok_rag(rag_id: str, vector_db_id: str) -> RagStore:
17121712
rag_id=rag_id,
17131713
vector_db_id=vector_db_id,
17141714
db_path="tests/configuration/rag.txt",
1715-
backend="rag",
1715+
backend="faiss",
17161716
embedding_model="model",
17171717
embedding_dimension=768,
17181718
score_multiplier=1.0,

0 commit comments

Comments
 (0)