diff --git a/api/api_v1/check_data/service.py b/api/api_v1/check_data/service.py index 1cddbe5..30d8f4e 100644 --- a/api/api_v1/check_data/service.py +++ b/api/api_v1/check_data/service.py @@ -48,7 +48,10 @@ async def check_data(game, data_in: schemas.CheckData): try: df = await ck_client.query_dataframe(sql) report['title'] = df.columns.tolist() - report['data'] = df.values.astype(str).tolist() + report['data'] = [] + for item in df.values: + report['data'].append([]) + report['data'][-1] = [str(i) for i in item] except clickhouse_driver.errors.ServerException as e: if e.code == 47: @@ -72,6 +75,8 @@ async def check_data(game, data_in: schemas.CheckData): if isinstance(df[k][0], str) and t == 'json': try: json.loads(df[k][0]) + pass_list.append(f'

通过:字段{k} 是期望的类型

') + continue except: fail_list.append( f"""

错误:字段{k} 期望{t}类型,不是json格式

""")