mirror of
https://github.com/VectifyAI/PageIndex.git
synced 2026-06-12 19:55:17 +02:00
fix(pifs): surface projection dimension mismatches
This commit is contained in:
parent
e293814bc0
commit
20b2225444
2 changed files with 19 additions and 2 deletions
|
|
@ -162,8 +162,7 @@ def _parse_agent_command(
|
|||
|
||||
def _filesystem_from_workspace(workspace: str) -> PageIndexFileSystem:
|
||||
filesystem = PageIndexFileSystem(Path(workspace).expanduser())
|
||||
with contextlib.suppress(Exception):
|
||||
filesystem.configure_existing_projection_retrieval()
|
||||
filesystem.configure_existing_projection_retrieval()
|
||||
return filesystem
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -25,6 +25,24 @@ def test_cli_workspace_configures_existing_projection_retrieval(monkeypatch, tmp
|
|||
assert filesystem.projection_retrieval_configured is True
|
||||
|
||||
|
||||
def test_cli_workspace_surfaces_projection_dimension_mismatch(monkeypatch, tmp_path):
|
||||
import pytest
|
||||
|
||||
from pageindex.filesystem import cli
|
||||
|
||||
class MismatchedFileSystem:
|
||||
def __init__(self, workspace):
|
||||
self.workspace = Path(workspace)
|
||||
|
||||
def configure_existing_projection_retrieval(self):
|
||||
raise RuntimeError("summary projection index dimension mismatch: rebuild")
|
||||
|
||||
monkeypatch.setattr(cli, "PageIndexFileSystem", MismatchedFileSystem)
|
||||
|
||||
with pytest.raises(RuntimeError, match="dimension mismatch"):
|
||||
cli._filesystem_from_workspace(str(tmp_path / "workspace"))
|
||||
|
||||
|
||||
def test_cli_passthrough_invokes_pifs_command_executor(monkeypatch, capsys, tmp_path):
|
||||
from pageindex.filesystem import cli
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue