Skip to content

Commit 5a32999

Browse files
authored
Merge pull request #123 from mindflowai/patch
Patch broken release
2 parents d4bbccb + fad88e8 commit 5a32999

File tree

6 files changed

+19
-8
lines changed

6 files changed

+19
-8
lines changed

mindflow/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.5.0"
1+
__version__ = "0.5.1"

mindflow/core/__init__.py

Whitespace-only changes.

mindflow/core/commands/delete.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,18 @@
1212

1313
def run_delete(document_paths: List[str]) -> str:
1414
"""Delete documents from MindFlow index."""
15-
document_references: List[DocumentReference] = resolve_paths_to_document_references(document_paths)
16-
17-
document_ids = [document_id for document_id in [get_document_id(document_reference.path, document_reference.document_type) for document_reference in document_references] if document_id is not None]
15+
document_references: List[DocumentReference] = resolve_paths_to_document_references(
16+
document_paths
17+
)
18+
19+
document_ids = [
20+
document_id
21+
for document_id in [
22+
get_document_id(document_reference.path, document_reference.document_type)
23+
for document_reference in document_references
24+
]
25+
if document_id is not None
26+
]
1827

1928
if not document_ids:
2029
return "No document IDs resolved. Nothing to delete."
@@ -30,4 +39,4 @@ def run_delete(document_paths: List[str]) -> str:
3039
Document.delete_bulk(document_ids)
3140
DocumentChunk.delete_bulk(document_chunk_ids)
3241

33-
return True, "Documents and associated chunks deleted successfully."
42+
return "Documents and associated chunks deleted successfully."

mindflow/core/commands/index.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def run_index(document_paths: List[str]) -> str:
3939
indexable_documents := get_indexable_documents(
4040
document_references, completion_model
4141
)
42-
):
42+
):
4343
return "No documents to index"
4444

4545
print_total_size_of_documents(indexable_documents)

mindflow/core/commands/query.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ def run_query(document_paths: List[str], query: str) -> str:
5252
top_k=100,
5353
)
5454
):
55-
return "No index for requested hashes. Please generate index for passed content."
55+
return (
56+
"No index for requested hashes. Please generate index for passed content."
57+
)
5658

5759
document_selection_batch: List[Tuple[str, DocumentChunk]] = [
5860
(document_hash_to_path[document_chunk.id.split("_")[0]], document_chunk)

mindflow/core/file_processing/git.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ def get_all_unignored_git_files_from_path(path: Union[str, os.PathLike]) -> List
2929
)
3030
git_files = output.stdout.decode().strip().split("\n")
3131
return [os.path.abspath(os.path.join(os.fspath(path), f)) for f in git_files]
32-
except GitError as error:
32+
except subprocess.CalledProcessError as error:
3333
logging.debug("Failed extract git files with 'git ls-files': %s", error)
3434
return []

0 commit comments

Comments
 (0)