Skip to content

Commit ceff988

Browse files
committed
feat: chart json axis value to lowercase
1 parent 399754c commit ceff988

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

backend/apps/chat/task/llm.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,16 @@ def check_save_chart(self, res: str) -> Dict[str, Any]:
662662
if data['type'] and data['type'] != 'error':
663663
# todo type check
664664
chart = data
665+
if chart.get('columns'):
666+
for v in chart.get('columns'):
667+
v['value'] = v.get('value').lower()
668+
if chart.get('axis'):
669+
if chart.get('axis').get('x'):
670+
chart.get('axis').get('x')['value'] = chart.get('axis').get('x').get('value').lower()
671+
if chart.get('axis').get('y'):
672+
chart.get('axis').get('y')['value'] = chart.get('axis').get('y').get('value').lower()
673+
if chart.get('axis').get('series'):
674+
chart.get('axis').get('series')['value'] = chart.get('axis').get('series').get('value').lower()
665675
elif data['type'] == 'error':
666676
message = data['reason']
667677
error = True

0 commit comments

Comments
 (0)