mirror of
https://github.com/ThearchyHelios/AgentLab.git
synced 2026-11-25 10:12:56 +00:00
探查范围外、没有注释的表中文需求命不中:照实写进模块说明,加一条测试钉住
真实模型验收里,范围外又没有注释的表只按英文名检索,中文需求命不中(data/schema_view 的 _outside_text 只放名字、拆出的词、 注释)。先查了有没有现成的英中业务词对照可以给拆出的词补上中文说法:命名推断只拆词、不翻译,catalog.name_words 也一样,仓库 里没有这样一份对照。按约定不临时编一份大词表(编出来的覆盖不全,还会把不相干的表抬上来),改成在模块说明里照实写清这个限制、 影响多大(真库多半有注释,注释照常参与检索;范围内的表另有目录中文名、列名)和怎么绕过去(按英文名点名查看会按需加入,或者 请管理员加进探查范围、补注释或目录中文名)。 测试:test_look_large.py::test_out_of_scope_objects_without_a_comment_match_only_their_english_name 钉住现在的行为 (英文名命中、中文需求命不中没注释的表、有注释的按注释命中),以后接了词表要跟着改。这一项只改说明、不改行为,没有 「去掉修复回跑」。
This commit is contained in:
@@ -236,3 +236,20 @@ async def test_out_of_scope_parent_is_not_called_missing(big):
|
||||
checks = catalog_profile.plan_checks("ord_hdr_east", tables["ord_hdr_east"], {"relations": [rel]},
|
||||
tables=tables, masked=set(), outside=outside)
|
||||
assert [c for c in checks if c.kind == "relation"][0].skip[0] == "missing"
|
||||
|
||||
|
||||
def test_out_of_scope_objects_without_a_comment_match_only_their_english_name():
|
||||
"""范围外、又没有注释的对象只有英文名可检索(data/schema_view 模块说明写明的限制):英文名拆出的词(catalog.name_words)
|
||||
没有中文说法——仓库里没有现成的英中业务词对照,不临时编词表,中文需求命不中只叫 refund_orders 的表;有注释的照常命中。
|
||||
以后接了词表,这条要跟着改。"""
|
||||
from types import SimpleNamespace
|
||||
|
||||
from app.data import schema_view
|
||||
|
||||
source = SimpleNamespace(schema_cache={"tables": {}}, options={})
|
||||
outside = [SimpleNamespace(name="refund_orders", comment=None),
|
||||
SimpleNamespace(name="cust_complaint", comment="客户投诉单")]
|
||||
search = schema_view.TableSearch(source, {}, outside)
|
||||
assert [h.name for h in search.search("refund", limit=5)] == ["refund_orders"], "英文名、拆出的词照常命中"
|
||||
assert "refund_orders" not in [h.name for h in search.search("上周的退款", limit=5)], "没有注释、没有词表:中文需求命不中英文名"
|
||||
assert [h.name for h in search.search("投诉", limit=5)] == ["cust_complaint"], "有注释的按注释命中"
|
||||
|
||||
Reference in New Issue
Block a user