From f9ba0ab3e24c703612fbb25f2f830f8ce3d18414 Mon Sep 17 00:00:00 2001 From: Mardone Date: Wed, 14 Feb 2024 15:24:20 -0300 Subject: [PATCH 1/2] Fix wrong method syntax --- bothub/api/v2/repository/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bothub/api/v2/repository/views.py b/bothub/api/v2/repository/views.py index 47809c33..c1437717 100644 --- a/bothub/api/v2/repository/views.py +++ b/bothub/api/v2/repository/views.py @@ -1413,7 +1413,7 @@ def get_xlsx(self, queryset): xlsx_response = usecase.create_xlsx_response(queryset) return xlsx_response - def get(self, request, *args, **kwargs): + def list(self, request, *args, **kwargs): queryset = self.filter_queryset(self.get_queryset()) xlsx_response = self.get_xlsx(queryset) return xlsx_response From dc4ca4f04fc6786a4b5386305fdf59ae91bfdda3 Mon Sep 17 00:00:00 2001 From: Mardone Date: Wed, 14 Feb 2024 16:32:03 -0300 Subject: [PATCH 2/2] Fix: Entities type --- bothub/common/usecase/repositorylog/export.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bothub/common/usecase/repositorylog/export.py b/bothub/common/usecase/repositorylog/export.py index f778fdb6..1f06c067 100644 --- a/bothub/common/usecase/repositorylog/export.py +++ b/bothub/common/usecase/repositorylog/export.py @@ -26,11 +26,18 @@ def _create_xlsx_workbook( row = 2 for repository_log in repository_logs: + entities = repository_log.nlp_log.entities.to_dict() + entities_list = [] + for entity_type, entities in entities.items(): + for entity in entities: + entities_list.append(f"{entity['entity']}:{entity['value']}") + entities_str = ', '.join(entities_list) + ws['A{}'.format(row)] = repository_log.nlp_log.text ws['B{}'.format(row)] = repository_log.created_at ws['C{}'.format(row)] = repository_log.nlp_log.intent.name ws['D{}'.format(row)] = repository_log.nlp_log.intent.confidence - ws['F{}'.format(row)] = repository_log.nlp_log.entities + ws['F{}'.format(row)] = entities_str row += 1 return wb