Skip to content

Commit b38b1dd

Browse files
committed
refactor : black check
1 parent 5aad33d commit b38b1dd

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

src/lang2sql/components/retrieval/_bm25.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
88
Tokenization: text.lower().split() (whitespace, no external deps)
99
"""
10+
1011
from __future__ import annotations
1112

1213
import math

src/lang2sql/components/retrieval/keyword.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ def __init__(
4949
super().__init__(name=name or "KeywordRetriever", hook=hook)
5050
self._catalog = catalog
5151
self._top_n = top_n
52-
self._index_fields = index_fields if index_fields is not None else _DEFAULT_INDEX_FIELDS
52+
self._index_fields = (
53+
index_fields if index_fields is not None else _DEFAULT_INDEX_FIELDS
54+
)
5355
self._index = _BM25Index(catalog, self._index_fields)
5456

5557
def run(self, run: RunContext) -> RunContext:
@@ -77,11 +79,7 @@ def run(self, run: RunContext) -> RunContext:
7779
)
7880

7981
# Return up to top_n entries that have a positive score
80-
results = [
81-
entry
82-
for score, entry in ranked[: self._top_n]
83-
if score > 0.0
84-
]
82+
results = [entry for score, entry in ranked[: self._top_n] if score > 0.0]
8583

8684
run.schema_selected = results
8785
return run

tests/test_components_keyword_retriever.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
Pattern follows test_core_base.py:
55
- pytest, inline fixtures, MemoryHook
66
"""
7+
78
import pytest
89

910
from lang2sql.components.retrieval import KeywordRetriever
1011
from lang2sql.core.context import RunContext
1112
from lang2sql.core.hooks import MemoryHook
1213
from lang2sql.flows.baseline import SequentialFlow
1314

14-
1515
# -------------------------
1616
# Shared test catalog
1717
# -------------------------
@@ -200,7 +200,12 @@ def test_missing_optional_fields_no_error():
200200
"""columns/meta 없는 entry가 있어도 crash 없음."""
201201
catalog = [
202202
{"name": "minimal", "description": "최소 필드만 있는 테이블"},
203-
{"name": "full", "description": "전체 필드", "columns": {"id": "ID"}, "meta": {}},
203+
{
204+
"name": "full",
205+
"description": "전체 필드",
206+
"columns": {"id": "ID"},
207+
"meta": {},
208+
},
204209
]
205210

206211
retriever = KeywordRetriever(catalog=catalog)

0 commit comments

Comments
 (0)