fix: Replace builtin 'callable' with 'Callable' type hint
- Fix streaming_ingest.py line 180: callable -> Callable - Fix streaming_adaptor.py line 39: callable -> Callable - Add Callable import from collections.abc and typing - Fixes TypeError in Python 3.11: unsupported operand type(s) for | - Resolves CI coverage report collection errors
This commit is contained in:
@@ -8,7 +8,7 @@ Enables memory-efficient processing of large documentation sets.
|
|||||||
|
|
||||||
import json
|
import json
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any
|
from typing import Any, Callable
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
# Add parent directory to path for imports
|
# Add parent directory to path for imports
|
||||||
@@ -36,7 +36,7 @@ class StreamingAdaptorMixin:
|
|||||||
chunk_size: int = 4000,
|
chunk_size: int = 4000,
|
||||||
chunk_overlap: int = 200,
|
chunk_overlap: int = 200,
|
||||||
batch_size: int = 100,
|
batch_size: int = 100,
|
||||||
progress_callback: callable | None = None,
|
progress_callback: Callable | None = None,
|
||||||
) -> Path:
|
) -> Path:
|
||||||
"""
|
"""
|
||||||
Package skill using streaming ingestion.
|
Package skill using streaming ingestion.
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ skill documentation. Handles chunking, progress tracking, and resume functionali
|
|||||||
import json
|
import json
|
||||||
import hashlib
|
import hashlib
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from collections.abc import Iterator
|
from collections.abc import Callable, Iterator
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
import time
|
import time
|
||||||
|
|
||||||
@@ -177,7 +177,7 @@ class StreamingIngester:
|
|||||||
return hashlib.md5(id_string.encode()).hexdigest()
|
return hashlib.md5(id_string.encode()).hexdigest()
|
||||||
|
|
||||||
def stream_skill_directory(
|
def stream_skill_directory(
|
||||||
self, skill_dir: Path, callback: callable | None = None
|
self, skill_dir: Path, callback: Callable | None = None
|
||||||
) -> Iterator[tuple[str, dict]]:
|
) -> Iterator[tuple[str, dict]]:
|
||||||
"""
|
"""
|
||||||
Stream all documents from skill directory.
|
Stream all documents from skill directory.
|
||||||
|
|||||||
Reference in New Issue
Block a user