fix: Python 3.9 compatibility - replace union types and builtin generics
- Replace 'str | None' with 'Optional[str]' - Replace 'list[str]' with 'List[str]' - Replace 'dict[' with 'Dict[' - Replace 'tuple[' with 'Tuple[' - Add missing typing imports (List, Dict, Tuple) Fixes TypeError: unsupported operand type(s) for |: 'type' and 'NoneType' 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -12,7 +12,7 @@ import shutil
|
||||
import subprocess
|
||||
import tempfile
|
||||
from pathlib import Path
|
||||
from typing import Optional
|
||||
from typing import Optional, Tuple
|
||||
|
||||
|
||||
class GraphPartitioner:
|
||||
@@ -92,7 +92,7 @@ class GraphPartitioner:
|
||||
output_dir: Optional[str] = None,
|
||||
partition_prefix: Optional[str] = None,
|
||||
**kwargs,
|
||||
) -> tuple[str, str]:
|
||||
) -> Tuple[str, str]:
|
||||
"""
|
||||
Partition a disk-based index for improved performance.
|
||||
|
||||
@@ -263,11 +263,11 @@ class GraphPartitioner:
|
||||
|
||||
def partition_graph(
|
||||
index_prefix_path: str,
|
||||
output_dir: str | None = None,
|
||||
partition_prefix: str | None = None,
|
||||
output_dir: Optional[str] = None,
|
||||
partition_prefix: Optional[str] = None,
|
||||
build_type: str = "release",
|
||||
**kwargs,
|
||||
) -> tuple[str, str]:
|
||||
) -> Tuple[str, str]:
|
||||
"""
|
||||
Convenience function to partition a graph index.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user