Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
star-nox committed Mar 13, 2024
1 parent f715906 commit 46d5a5e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions ai_ta_backend/service/export_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 4 additions & 1 deletion ai_ta_backend/utils/context_parent_doc_padding.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down

0 comments on commit 46d5a5e

Please sign in to comment.