mirror of
https://github.com/safishamsi/graphify.git
synced 2026-09-28 08:25:48 +00:00
The 0.8.43 str-path coercion (#1386) ran Path(f) over every item in extract_files_direct, but extract_corpus_parallel feeds it FileSlice units from the oversized-doc slicing (#1369), and Path(FileSlice) raises TypeError -- so semantic extraction of any Markdown file larger than _FILE_CHAR_CAP crashed. Coerce only non-Path/non-FileSlice entries. The #1386 tests used small files, so slicing never ran; added a regression test with a file that actually slices. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
+5
-3
@@ -1306,9 +1306,11 @@ def extract_files_direct(
|
||||
|
||||
Accepts ``str`` paths as well as ``Path``; string entries are coerced up
|
||||
front so downstream helpers (``_partition_semantic_files``, ``_read_files``,
|
||||
``_build_image_refs``) can rely on ``Path`` semantics (#1386).
|
||||
``_build_image_refs``) can rely on ``Path`` semantics (#1386). FileSlice units
|
||||
(from extract_corpus_parallel's oversized-doc slicing, #1369) pass through
|
||||
untouched — Path(FileSlice) would raise (#1397/#1399).
|
||||
"""
|
||||
files = [Path(f) for f in files]
|
||||
files = [f if isinstance(f, (Path, FileSlice)) else Path(f) for f in files]
|
||||
if backend is None:
|
||||
backend = detect_backend()
|
||||
if backend is None:
|
||||
@@ -1737,7 +1739,7 @@ def extract_corpus_parallel(
|
||||
Accepts ``str`` paths as well as ``Path``; string entries are coerced up
|
||||
front so packing/slicing helpers can rely on ``Path`` semantics (#1386).
|
||||
"""
|
||||
files = [Path(f) for f in files]
|
||||
files = [f if isinstance(f, (Path, FileSlice)) else Path(f) for f in files]
|
||||
# Split oversized splittable documents into slices that cover the whole file
|
||||
# before packing, so content past _FILE_CHAR_CAP is extracted instead of
|
||||
# silently dropped (#1369). Files at/under the cap pass through unchanged.
|
||||
|
||||
Reference in New Issue
Block a user