mirror of
https://github.com/ThearchyHelios/AgentLab.git
synced 2026-11-21 16:21:57 +00:00
核查工具箱收尾:连接的方面补上另一侧(关联条件里出现的别的表,CROSS JOIN 写它之前的来源),双盲复算对照数据目录里的关系时用得上;只读 agent 收尾前先拿到收尾用的模型再预留金额,模型拿不到时不在每日账上白记一次调用;收尾消息的参数改名 limit_words,说清是哪个上限的说法
This commit is contained in:
@@ -116,7 +116,7 @@ def test_tables_are_the_real_tables_without_cte_names():
|
||||
def test_joins_carry_kind_both_sides_and_a_normalized_condition():
|
||||
f = facets("SELECT o.id FROM orders o LEFT JOIN refunds r ON r.order_id = o.id AND r.state = 'done'")
|
||||
[join] = f.joins
|
||||
assert join.kind == "left" and join.table.text == "refunds"
|
||||
assert join.kind == "left" and join.table.text == "refunds" and join.other == ("orders",)
|
||||
# 别名换成真实表名,两边排好顺序,几个条件按 key 排序后用 AND 连起来
|
||||
assert join.on.text == "orders.id = refunds.order_id AND refunds.state = 'done'"
|
||||
same = facets("SELECT orders.id FROM orders LEFT OUTER JOIN refunds ON refunds.state = 'done' "
|
||||
@@ -128,6 +128,9 @@ def test_a_comma_join_is_the_same_as_an_inner_join():
|
||||
comma = facets("SELECT a.x FROM orders a, stores b WHERE a.store_id = b.id AND b.city = '虚构市'")
|
||||
inner = facets("SELECT orders.x FROM orders JOIN stores ON stores.id = orders.store_id WHERE stores.city = '虚构市'")
|
||||
assert comma.joins == inner.joins and comma.joins[0].kind == "inner"
|
||||
assert comma.joins[0].table.text == "stores" and comma.joins[0].other == ("orders",)
|
||||
cross = facets("SELECT 1 FROM orders o CROSS JOIN stores s")
|
||||
assert (cross.joins[0].kind, cross.joins[0].on, cross.joins[0].other) == ("cross", None, ("orders",))
|
||||
assert [p.key for p in comma.where] == [p.key for p in inner.where] == ["stores.city = '虚构市'"]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user