mirror of
https://github.com/ThearchyHelios/AgentLab.git
synced 2026-11-19 16:22:01 +00:00
大库的 look 预筛与按需加入、剖析事实四处一致、有效记录条件按 quote_name 加引号的测试;对象索引批量更新改走按表的 executemany
为什么:A2 和遗留 e 的行为要有脚本化的验收,且能证明测试抓得住回归(去掉遮罩重滤、去掉 quote_name 强制引号后对应用例都失败, 已回跑确认)。 - tests/test_look_large.py:3,000 张表的合成库,探查范围 300 张 + 5 张有目录的表,其余只在对象索引里(注释写进索引,模拟 MySQL / PG 的表注释)。10 条脚本化需求挑中 ≥ 9 条、挑选提示词 < 20,000 字(挑选用按字面重合打分的假模型,只看得到交给它的 那份目录);挑中范围外的表按需加入、记 added_to_scope 和留痕;点名的每次查看最多 4 张、超了照实说;db_schema__ 的 keyword、 只列前 50 张、每次运行最多 8 张;查询照实列「未按目录检查的表」;目录搜索和「加入范围」;剖析的关系指向范围外时不说 「表结构里没有」。 - tests/test_profile_facts.py:look、运行时 db_schema、/schema、表助手四处同一段剖析事实和固定提示;剖析之后加遮罩,那一列 的范围不出现;没有剖析结果时表详情一字不差;上传表格快照不一致(含没记快照的)不给;剖析任务开始一张表时记下快照; 「上次剖析」取真正开始过的那一次。 - tests/test_valid_filter_quote.py:存进目录的写法和剖析核对查询都按 quote_name 给 Oracle 小写列加引号。 - source_objects.refresh_index:注释、类型、行数估算有变的行改用按表的 executemany(ORM 的按主键批量更新要求参数里写主键 列名,3,000 张表的库第二次刷新索引时报错)。 - db_schema__ 不传 table 时说清没列出的里有几张在探查范围外。
This commit is contained in:
@@ -480,11 +480,13 @@ async def refresh_index(session: AsyncSession, source_id: str, schema: str, resu
|
||||
for chunk in _chunks(new_rows):
|
||||
await session.execute(insert(_SO), chunk)
|
||||
if changed:
|
||||
stmt = (update(_SO).where(_SO.id == bindparam("_id"))
|
||||
.values(kind=bindparam("kind"), comment=bindparam("comment"), est_rows=bindparam("est_rows"))
|
||||
.execution_options(synchronize_session=False))
|
||||
# 按表(不按 ORM 实体)的 executemany:ORM 的按主键批量更新要求参数里写主键列的名字
|
||||
table = SourceObject.__table__
|
||||
stmt = (update(table).where(table.c.id == bindparam("_id"))
|
||||
.values(kind=bindparam("kind"), comment=bindparam("comment"), est_rows=bindparam("est_rows")))
|
||||
conn = await session.connection()
|
||||
for chunk in _chunks(changed):
|
||||
await session.execute(stmt, chunk)
|
||||
await conn.execute(stmt, chunk)
|
||||
still = [r.id for name, r in existing.items() if name in seen]
|
||||
for chunk in _chunks(still):
|
||||
await session.execute(update(_SO).where(_SO.id.in_(chunk)).values(last_seen_at=now)
|
||||
|
||||
Reference in New Issue
Block a user