From 46d5a5e61c0082be904c1adf89063bdc963e7457 Mon Sep 17 00:00:00 2001 From: star-nox Date: Wed, 13 Mar 2024 16:28:08 -0500 Subject: [PATCH] minor changes --- ai_ta_backend/service/export_service.py | 3 +++ ai_ta_backend/utils/context_parent_doc_padding.py | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ai_ta_backend/service/export_service.py b/ai_ta_backend/service/export_service.py index 6eb889c2..9d12c8c4 100644 --- a/ai_ta_backend/service/export_service.py +++ b/ai_ta_backend/service/export_service.py @@ -34,6 +34,7 @@ def export_documents_json(self, course_name: str, from_date='', to_date=''): """ response = self.sql.getDocumentsBetweenDates(course_name, from_date, to_date, 'documents') + print("response count: ", response.count) # add a condition to route to direct download or s3 download if response.count > 1000: # call background task to upload to s3 @@ -108,6 +109,8 @@ def export_data_in_bg(self, response, download_type, course_name, s3_path): course_name (str): The name of the course. s3_path (str): The S3 path where the file will be uploaded. """ + print("Exporting data in background...") + print(response) total_doc_count = response.count first_id = response.data[0]['id'] print("total_doc_count: ", total_doc_count) diff --git a/ai_ta_backend/utils/context_parent_doc_padding.py b/ai_ta_backend/utils/context_parent_doc_padding.py index fc0ba19c..1ce559d5 100644 --- a/ai_ta_backend/utils/context_parent_doc_padding.py +++ b/ai_ta_backend/utils/context_parent_doc_padding.py @@ -3,11 +3,14 @@ from concurrent.futures import ProcessPoolExecutor from functools import partial from multiprocessing import Manager +from ai_ta_backend.database.sql import SQLDatabase -DOCUMENTS_TABLE = os.environ['SUPABASE_DOCUMENTS_TABLE'] + +# DOCUMENTS_TABLE = os.environ['SUPABASE_DOCUMENTS_TABLE'] # SUPABASE_CLIENT = supabase.create_client(supabase_url=os.environ['SUPABASE_URL'], # supabase_key=os.environ['SUPABASE_API_KEY']) # type: ignore +SQL_DB = SQLDatabase def context_parent_doc_padding(found_docs, search_query, course_name): """