Conversation
Member
kemingy
commented
Mar 11, 2025
- remove legacy code
- support jsonb for pg, fix datetime to timestamptz
- use psycopg string composition to make it safe
- fix some type errors
- support jsonb for pg, fix datetime to timestamptz - use psycopg string composition to make it safe - fix some type errors Signed-off-by: Keming <kemingyang@tensorchord.ai>
Contributor
There was a problem hiding this comment.
PR Overview
This PR introduces safer SQL composition by migrating from legacy string formatting to psycopg’s SQL construction methods, while also removing deprecated code and updating type configurations.
- Upgrade Python version and dependencies in pyproject.toml
- Update SQL commands using psycopg’s sql module to prevent injection risks
- Remove legacy files and adjust type hints and error handling in various modules
Reviewed Changes
| File | Description |
|---|---|
| pyproject.toml | Updated Python version and dependency versions with additional mypy config |
| vechord/registry.py | Refactored pipeline and table registration; added logging and minor typos |
| vechord/load.py | Replaced placeholder pass with NotImplementedError |
| vechord/client.py | Migrated legacy SQL string formatting to psycopg safely and updated select/insert |
| vechord/rerank.py | Marked unimplemented method with NotImplementedError |
| vechord/init.py | Removed legacy export references |
| README.md | Updated documentation and docker command changes |
| examples/*, vechord/main.py | Removed legacy examples and main entry point |
| vechord/model.py | Removed deprecated Chunk class |
| vechord/chunk.py | Added type annotations for clarity |
| vechord/evaluate.py | Updated type hints to utilize Sequence instead of list |
| vechord/spec.py | Added jsonb support and adjusted datetime mapping; improved error handling |
| vechord/pipeline.py | Legacy pipeline file removed |
Copilot reviewed 21 out of 21 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
vechord/registry.py:45
- The variable name 'vector_colume' appears to be misspelled. Consider renaming it to 'vector_column' for clarity.
if vector_colume := table.vector_column():
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.