A table with some array type columns, Chinese cannot display correctly.
How to reproduce the bug
As I already add a dataset named 'array_table'.
1. Go to 'SqlLab'
select * from * from array_table limit 10
2. Click on 'RUN'
3. Scroll down to 'RESULTS'
4. See error,
Expected results
Chinese array columns display correctly.
Actual results
Screenshots
Environment
(please complete the following information):
- browser type and version: Chrome
- superset version: 1.4
- python version: 3.7.9
- node.js version: 14.15.5
- any feature flags active:
Checklist
Make sure to follow these steps before submitting your issue - thank you!
- [x] I have checked the superset logs for python stacktraces and included it here as text if there are any.
- [x] I have reproduced the issue with at least the latest released version of superset.
- [x] I have checked the issue tracker for the same issue and I haven't found one similar.
Additional context
Add any other context about the problem here.
Comment From: zhaoyongjie
Hi, What database and column type are you using on the issue?
Comment From: tong900801
@zhaoyongjie Thank you for your reply. I'm using clickhouse for data analysis. It displayed correct Chinese in database. Column type is Array(String).
Comment From: tong900801
And I saw there is a "# TODO: revisit nested column serialization once nested types" in https://github.com/apache/superset/blob/master/superset/result_set.py
Comment From: tong900801
@zhaoyongjie
I saw array type column was changed in stringify() method in result_set.py. I want to know why it was changed. What's the influence if using ensure_ascii=False.
def stringify(obj: Any) -> str:
return json.dumps(obj, default=utils.json_iso_dttm_ser)
Thanks.
Comment From: rusackas
@tong900801 let us know if you're still facing this issue in current Superset (i.e. 2.0.x or master
). Pinging @zhaoyongjie regarding the open question, and @villebro who last touched the TODO comment noted above, in case either of them have additional context to help move this issue along in one way or another.
Comment From: lipan1024
@rusackas I encountered the same issue.
SELECT '你好' as col1, '长沙' as col2, array('你好','长沙') as col3;
Environment
(please complete the following information):
browser type and version: Chrome superset version: 2.0.0 python version: 3.8.12
Comment From: kgneng2
@tong900801 @lipan1024 @rusackas @zhaoyongjie @villebro
I encountered the same issue.
please fix this problem.
my superset version is 2.1.1 python 3.8.16
add ensure_ascii=False
or..
how fix this problem any version?
plaese add option in config.py
thanks
Comment From: rusackas
This bug partly overlaps the linked issue above, but I think both are valid. This one seems to concern the Chinese characters more than the format of the column. The other is more about the column data type. Let's consider them separately if we can :)
Comment From: rusackas
Related: https://github.com/apache/superset/issues/29224
Comment From: rusackas
Is this still an issue in 4.1.1 or newer? This has gone silent for quite a while, so I'm not sure if the situation has improved.
Comment From: rusackas
Hopeful that #33720 will resolve this, but let us know if you can review the PR and/or validate the status of things on the PR branch.