Skip to content

Commit be490de

Browse files
committed
fix(lint): add strict=True to zip() calls for Python 3.11+
Ruff B905 rule requires explicit strict= parameter for zip() when targeting Python 3.11+. Using strict=True ensures both iterables have the same length, which is the expected behaviour in these cases.
1 parent 4d52092 commit be490de

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

stackone_ai/meta_tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def search(self, query: str, limit: int = 5, min_score: float = 0.0) -> list[Met
122122
score_map: dict[str, dict[str, float]] = {}
123123

124124
# Add BM25 scores
125-
for idx, score in zip(bm25_results[0], bm25_scores[0]):
125+
for idx, score in zip(bm25_results[0], bm25_scores[0], strict=True):
126126
tool_name = self.tool_names[idx]
127127
# Normalize BM25 score to 0-1 range
128128
normalized_score = float(1 / (1 + np.exp(-score / 10)))

stackone_ai/utils/tfidf_index.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def build(self, corpus: list[TfidfDocument]) -> None:
138138

139139
# Build document vectors
140140
self.docs = []
141-
for doc, tokens in zip(corpus, docs_tokens):
141+
for doc, tokens in zip(corpus, docs_tokens, strict=True):
142142
# Compute term frequency (TF)
143143
tf: dict[int, int] = {}
144144
for token in tokens:

0 commit comments

Comments
 (0)