统一:DSH 智能分析、Top100 与图表静默恢复
接入 DSH 专用运行时和对话界面,保留模型原始回答,支持会话分页、连续追问与显式报告。 补齐组合筛选、各维度 Top100、分组查询到排名图的转换,图表故障静默省略并基于保存数据自动恢复。 优化报告风格、图表顺序和表格换行,更新接入说明及构建输入。 验证:独立目录前后端构建通过;118 项 Java、102 项前端、102 项图表、14 项 DSH 应用和 13 项组合筛选检查通过。 仅提交相关源码、锁定依赖与测试;不包含凭据、会话、业务数据或本地产物。
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import json
|
||||
import copy
|
||||
import sys
|
||||
import unittest
|
||||
@@ -28,6 +29,27 @@ def bundle(value,queries):
|
||||
|
||||
|
||||
class VisualRecoveryTests(unittest.TestCase):
|
||||
def test_native_product_ranking_recovers_from_exact_frozen_batch_without_queryplan(self):
|
||||
value=task();value.update(executionMode='native_agent',kind='analysis',trendRequired=False,
|
||||
dimensions=['product'],stages=['black'],fields=['rate','totalWeight'])
|
||||
value['aggregateSelection']={'dimension':'product','metric':'rate','rateStage':None,'direction':'asc',
|
||||
'limit':100,'requestQuestion':'筛选合格率最低Top100产品并生成报告',
|
||||
'weightFilter':{'metric':'totalWeight','stage':'black','operator':'gt','value':1.0}}
|
||||
raw={**value,'_view':'product'};saved=query(raw,BoundRankingApi())
|
||||
for row in saved['response']['rows']:row['compositeRate']=.9
|
||||
scope={'nodeId':'product-batch','scopeId':'scope-products','purpose':'metrics','limit':500,'task':{**value,'kind':'metrics'}}
|
||||
for key in ('nodeId','scopeId'):saved[key]=saved['proof'][key]=scope[key]
|
||||
request=bundle(value,[saved]);request['scopes']=[scope]
|
||||
with patch.object(SavedResponses,'_client',side_effect=AssertionError('no network')):
|
||||
result=rebuild(request)
|
||||
self.assertEqual(result['visualState'],'ready')
|
||||
self.assertTrue(result['visuals'])
|
||||
self.assertEqual(result['visuals'][0]['dimension'],'product')
|
||||
self.assertEqual(result['queryRefs'][0]['queryIds'],[saved['queryId']])
|
||||
from decimal import Decimal
|
||||
decimal_wire = json.loads(json.dumps(request), parse_float=Decimal)
|
||||
self.assertEqual(rebuild(decimal_wire)['visualState'], 'ready')
|
||||
|
||||
def test_trend_is_rebuilt_from_only_the_frozen_response_without_api_or_model(self):
|
||||
value=task({'product':'18X15X4+T'});saved=query(value);original=copy.deepcopy(saved)
|
||||
with patch.object(SavedResponses,'_client',side_effect=AssertionError('no network')):
|
||||
|
||||
Reference in New Issue
Block a user