mirror of
https://github.com/ThearchyHelios/AgentLab.git
synced 2026-11-24 14:02:13 +00:00
同义词随定义一起留在口径卡上
文档里叫「月活」,卡上指标叫「月度活跃买家」;同义词丢了,以后按名字找这份口径就永远对不上。 合并时带上(大小写与空白不算新说法),并让口径描述把它交出去。
This commit is contained in:
@@ -131,3 +131,15 @@ async def test_an_external_only_card_is_not_promised_automatic_issuance(client):
|
||||
assert made["composable"] is True
|
||||
assert made["issuance"]["auto_issue"] is False
|
||||
assert any("没有取数节点" in r for r in made["issuance"]["reasons"])
|
||||
|
||||
|
||||
async def test_metric_synonyms_reach_the_descriptor(client):
|
||||
"""文档带来的同义词要出现在机器可读描述里:按名字找口径时,「月活」和指标名一样是入口。"""
|
||||
graph = S.caliber_graph()
|
||||
for node in graph["nodes"]:
|
||||
if node["type"] == "metrics":
|
||||
node["data"]["config"]["metrics"][0]["synonyms"] = ["月活", "MAU"]
|
||||
wf = await S.publish(graph=graph)
|
||||
[made] = await descriptors(client, wf)
|
||||
[metric] = made["metrics"]
|
||||
assert metric["synonyms"] == ["月活", "MAU"]
|
||||
|
||||
@@ -177,6 +177,8 @@ def test_merge_definition_matches_by_synonym_and_keeps_expression():
|
||||
assert card["id"] == "gmv"
|
||||
assert card["expression"] == "cell(nodes.q, 0, '金额')"
|
||||
assert card["definition"] == {"text": "新说明", "owner": "财务", "scope": "全渠道"}
|
||||
# 文档里的叫法要留在卡上:以后按同义词找这份口径,「成交额」才对得上
|
||||
assert card["synonyms"] == ["GMV"]
|
||||
assert len(warnings) == 1 and "客单价" in warnings[0]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user