Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(perf): increased perf embedding and search for files #1182

Merged
merged 3 commits into from
Sep 15, 2023

Conversation

StanGirard
Copy link
Collaborator

Embedding is now a task

Created new task for embedding

Created new column file_sha 1

@vercel
Copy link

vercel bot commented Sep 15, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs 🛑 Canceled (Inspect) Sep 15, 2023 9:40pm
quivrapp ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 15, 2023 9:40pm

@StanGirard StanGirard temporarily deployed to preview September 15, 2023 21:38 — with GitHub Actions Inactive
@StanGirard StanGirard merged commit 4d41901 into main Sep 15, 2023
7 of 9 checks passed
@github-actions
Copy link
Contributor

Risk Level 2 - /home/runner/work/quivr/quivr/backend/models/databases/supabase/vectors.py

The code changes are minimal and seem to be well written. However, there is a potential risk of the set_file_sha_from_metadata function not updating the file_sha1 field correctly. It would be better to add error handling to ensure that the update operation is successful.

+    def set_file_sha_from_metadata(self, file_sha1):
+        response = (
+            self.db.table(\"vectors\")
+            .update({\"file_sha1\": file_sha1})
+            .match({\"metadata->>file_sha1\": file_sha1})
+            .execute()
+        )
+        if response.error is not None:
+            raise Exception('Update operation failed')
+        return response

Risk Level 2 - /home/runner/work/quivr/quivr/backend/celery_task.py

The code seems to be well written and follows the SOLID principles. However, there is a potential risk of the get_supabase_db function not returning a valid database connection. This could lead to a NoneType error when trying to call database.set_file_sha_from_metadata(file_sha1). It would be better to add error handling to ensure that the database connection is valid before using it.

+    database = get_supabase_db()
+    if database is not None:
+        database.set_file_sha_from_metadata(file_sha1)
+    else:
+        raise Exception('Database connection failed')

📝🔍🐞


Powered by Code Review GPT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant