Skip to content

Commit eb46486

Browse files
authored
Merge pull request #20 from byte-power/feature/dev/export_json
dumps添加对中文支持
2 parents f06b787 + 31e0713 commit eb46486

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Change Log
22

3+
## v1.1.1 - 2022-05-05
4+
This release has several major changes:
5+
6+
- Polydash-Bug Fix:导出excel或者csv时,json格式字段中的特殊字符被变化, 修复中文字符被转码
7+
- Polydash:Counter 图表类型优化
8+
39
## v1.1.0 - 2022-04-29
410
This release has several major changes:
511

redash/serializers/query_result.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def _convert_json_or_jsonb(value):
5050
try:
5151
ret = value
5252
if isinstance(value, (list, dict)):
53-
ret = json.dumps(value)
53+
ret = json.dumps(value, ensure_ascii=False)
5454
except Exception:
5555
return value
5656

@@ -133,7 +133,7 @@ def serialize_query_result_to_xlsx(query_result):
133133
for c, name in enumerate(column_names):
134134
v = row.get(name)
135135
if isinstance(v, (dict, list)):
136-
v = json.dumps(v)
136+
v = json.dumps(v, ensure_ascii=False)
137137
sheet.write(r + 1, c, v)
138138

139139
book.close()

0 commit comments

Comments
 (0)