Skip to content

refactor: change VectorStore interface #783

refactor: change VectorStore interface

refactor: change VectorStore interface #783

GitHub Actions / JUnit Test Report failed Jan 24, 2025 in 0s

305 tests run, 223 passed, 9 skipped, 73 failed.

Annotations

Check failure on line 100 in packages/ragbits-core/tests/cli/test_vector_store.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_vector_store.test_vector_store_list

AssertionError: assert 1 == 0
 +  where 1 = <Result ValueError('Entry must have embedding_type in metadata')>.exit_code
Raw output
def test_vector_store_list():
        runner = CliRunner(mix_stderr=False)
        result = runner.invoke(
            vector_stores_app,
            ["--factory-path", "cli.test_vector_store:vector_store_factory", "list"],
        )
>       assert result.exit_code == 0
E       AssertionError: assert 1 == 0
E        +  where 1 = <Result ValueError('Entry must have embedding_type in metadata')>.exit_code

packages/ragbits-core/tests/cli/test_vector_store.py:100: AssertionError

Check failure on line 112 in packages/ragbits-core/tests/cli/test_vector_store.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_vector_store.test_vector_store_list_limit_offset

AssertionError: assert 1 == 0
 +  where 1 = <Result ValueError('Entry must have embedding_type in metadata')>.exit_code
Raw output
def test_vector_store_list_limit_offset():
        runner = CliRunner(mix_stderr=False)
        result = runner.invoke(
            vector_stores_app,
            ["--factory-path", "cli.test_vector_store:vector_store_factory", "list", "--limit", "1", "--offset", "1"],
        )
>       assert result.exit_code == 0
E       AssertionError: assert 1 == 0
E        +  where 1 = <Result ValueError('Entry must have embedding_type in metadata')>.exit_code

packages/ragbits-core/tests/cli/test_vector_store.py:112: AssertionError

Check failure on line 124 in packages/ragbits-core/tests/cli/test_vector_store.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_vector_store.test_vector_store_list_columns

AssertionError: assert 1 == 0
 +  where 1 = <Result ValueError('Entry must have embedding_type in metadata')>.exit_code
Raw output
def test_vector_store_list_columns():
        runner = CliRunner(mix_stderr=False)
        result = runner.invoke(
            vector_stores_app,
            ["--factory-path", "cli.test_vector_store:vector_store_factory", "list", "--columns", "id,key,metadata"],
        )
>       assert result.exit_code == 0
E       AssertionError: assert 1 == 0
E        +  where 1 = <Result ValueError('Entry must have embedding_type in metadata')>.exit_code

packages/ragbits-core/tests/cli/test_vector_store.py:124: AssertionError

Check failure on line 156 in packages/ragbits-core/tests/cli/test_vector_store.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_vector_store.test_vector_store_list_columns_non_existent

AssertionError: assert 'Unknown column: non_existent' in ''
 +  where '' = <Result ValueError('Entry must have embedding_type in metadata')>.stderr
Raw output
def test_vector_store_list_columns_non_existent():
        runner = CliRunner(mix_stderr=False)
        result = runner.invoke(
            vector_stores_app,
            ["--factory-path", "cli.test_vector_store:vector_store_factory", "list", "--columns", "id,key,non_existent"],
        )
        assert result.exit_code == 1
>       assert "Unknown column: non_existent" in result.stderr
E       AssertionError: assert 'Unknown column: non_existent' in ''
E        +  where '' = <Result ValueError('Entry must have embedding_type in metadata')>.stderr

packages/ragbits-core/tests/cli/test_vector_store.py:156: AssertionError

Check failure on line 165 in packages/ragbits-core/tests/cli/test_vector_store.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_vector_store.test_vector_store_remove

AssertionError: assert 1 == 0
 +  where 1 = <Result ValueError('Entry must have embedding_type in metadata')>.exit_code
Raw output
def test_vector_store_remove():
        runner = CliRunner(mix_stderr=False)
        result = runner.invoke(
            vector_stores_app,
            ["--factory-path", "cli.test_vector_store:vector_store_factory_for_remove", "remove", "1", "3"],
        )
>       assert result.exit_code == 0
E       AssertionError: assert 1 == 0
E        +  where 1 = <Result ValueError('Entry must have embedding_type in metadata')>.exit_code

packages/ragbits-core/tests/cli/test_vector_store.py:165: AssertionError

Check failure on line 193 in packages/ragbits-core/tests/cli/test_vector_store.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_vector_store.test_vector_store_query

AssertionError: assert 1 == 0
 +  where 1 = <Result ValueError('Entry must have embedding_type in metadata')>.exit_code
Raw output
def test_vector_store_query():
        runner = CliRunner(mix_stderr=False)
        result = runner.invoke(
            vector_stores_app,
            [
                "--factory-path",
                "cli.test_vector_store:vector_store_factory",
                "query",
                "--embedder-factory-path",
                "cli.test_vector_store:embedder_factory",
                "--k",
                "1",
                "example query",
            ],
        )
        print(result.stderr)
>       assert result.exit_code == 0
E       AssertionError: assert 1 == 0
E        +  where 1 = <Result ValueError('Entry must have embedding_type in metadata')>.exit_code

packages/ragbits-core/tests/cli/test_vector_store.py:193: AssertionError

Check failure on line 214 in packages/ragbits-core/tests/cli/test_vector_store.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_vector_store.test_vector_store_list_json

AssertionError: assert 1 == 0
 +  where 1 = <Result ValueError('Entry must have embedding_type in metadata')>.exit_code
Raw output
def test_vector_store_list_json():
        autoregister()
        runner = CliRunner(mix_stderr=False)
        result = runner.invoke(
            root_app,
            [
                "--output",
                "json",
                "vector-store",
                "--factory-path",
                "cli.test_vector_store:vector_store_factory",
                "list",
            ],
        )
        print(result.stderr)
>       assert result.exit_code == 0
E       AssertionError: assert 1 == 0
E        +  where 1 = <Result ValueError('Entry must have embedding_type in metadata')>.exit_code

packages/ragbits-core/tests/cli/test_vector_store.py:214: AssertionError

Check failure on line 42 in packages/ragbits-core/tests/cli/test_vector_store.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_vector_store.test_handling_document_ingestion_with_different_content_and_verifying_replacement[vector_store0]

TypeError: DocumentProcessorRouter.__init__() missing 1 required positional argument: 'providers'
Raw output
vector_store = <ragbits.core.vector_stores.in_memory.InMemoryVectorStore object at 0x7f6acf4fa890>

    @pytest.mark.parametrize(
        "vector_store",
        [
            InMemoryVectorStore(),
            ChromaVectorStore(
                client=EphemeralClient(),
                index_name="test_index_name",
            ),
            QdrantVectorStore(
                client=AsyncQdrantClient(":memory:"),
                index_name="test_index_name",
            ),
        ],
    )
    async def test_handling_document_ingestion_with_different_content_and_verifying_replacement(
        vector_store: VectorStore,
    ) -> None:
        document_1_content = "This is a test sentence and it should be in the vector store"
        document_2_content = "This is another test sentence and it should be removed from the vector store"
        document_2_new_content = "This is one more test sentence and it should be added to the vector store"
    
        document_1 = DocumentMeta.create_text_document_from_literal(document_1_content)
        document_2 = DocumentMeta.create_text_document_from_literal(document_2_content)
    
        embedder = AsyncMock()
        embedder.embed_text.return_value = [[0.0], [0.0]]
>       document_search = DocumentSearch(
            embedder=embedder,
            vector_store=vector_store,
        )

packages/ragbits-core/tests/integration/vector_stores/test_vector_store.py:42: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <ragbits.document_search._main.DocumentSearch object at 0x7f6abdb8ed10>
vector_store = <ragbits.core.vector_stores.in_memory.InMemoryVectorStore object at 0x7f6acf4fa890>
embedder = <AsyncMock id='140096550957840'>, document_processor_router = None
processing_strategy = None, source_resolver = None, default_options = None

    def __init__(
        self,
        vector_store: VectorStore,
        embedder: Embeddings,
        document_processor_router: DocumentProcessorRouter | None = None,
        processing_strategy: ProcessingExecutionStrategy | None = None,
        source_resolver: SourceResolver | None = None,
        default_options: DocumentSearchOptions | None = None,
    ) -> None:
        """
        Constructs a new DocumentSearch instance.
    
        Args:
            vector_store: The vector store to use.
            embedder: The embedder to use.
            document_processor_router: The document processor router to use.
            processing_strategy: The processing strategy to use.
            source_resolver: The source resolver to use.
            default_options: The default options for searching.
        """
        self.vector_store = vector_store
        self.embedder = embedder
>       self.document_processor_router = document_processor_router or DocumentProcessorRouter()
E       TypeError: DocumentProcessorRouter.__init__() missing 1 required positional argument: 'providers'

packages/ragbits-document-search/src/ragbits/document_search/_main.py:96: TypeError

Check failure on line 42 in packages/ragbits-core/tests/cli/test_vector_store.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_vector_store.test_handling_document_ingestion_with_different_content_and_verifying_replacement[vector_store1]

TypeError: DocumentProcessorRouter.__init__() missing 1 required positional argument: 'providers'
Raw output
vector_store = <ragbits.core.vector_stores.chroma.ChromaVectorStore object at 0x7f6ac4c91d80>

    @pytest.mark.parametrize(
        "vector_store",
        [
            InMemoryVectorStore(),
            ChromaVectorStore(
                client=EphemeralClient(),
                index_name="test_index_name",
            ),
            QdrantVectorStore(
                client=AsyncQdrantClient(":memory:"),
                index_name="test_index_name",
            ),
        ],
    )
    async def test_handling_document_ingestion_with_different_content_and_verifying_replacement(
        vector_store: VectorStore,
    ) -> None:
        document_1_content = "This is a test sentence and it should be in the vector store"
        document_2_content = "This is another test sentence and it should be removed from the vector store"
        document_2_new_content = "This is one more test sentence and it should be added to the vector store"
    
        document_1 = DocumentMeta.create_text_document_from_literal(document_1_content)
        document_2 = DocumentMeta.create_text_document_from_literal(document_2_content)
    
        embedder = AsyncMock()
        embedder.embed_text.return_value = [[0.0], [0.0]]
>       document_search = DocumentSearch(
            embedder=embedder,
            vector_store=vector_store,
        )

packages/ragbits-core/tests/integration/vector_stores/test_vector_store.py:42: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <ragbits.document_search._main.DocumentSearch object at 0x7f6abe2be380>
vector_store = <ragbits.core.vector_stores.chroma.ChromaVectorStore object at 0x7f6ac4c91d80>
embedder = <AsyncMock id='140096544795872'>, document_processor_router = None
processing_strategy = None, source_resolver = None, default_options = None

    def __init__(
        self,
        vector_store: VectorStore,
        embedder: Embeddings,
        document_processor_router: DocumentProcessorRouter | None = None,
        processing_strategy: ProcessingExecutionStrategy | None = None,
        source_resolver: SourceResolver | None = None,
        default_options: DocumentSearchOptions | None = None,
    ) -> None:
        """
        Constructs a new DocumentSearch instance.
    
        Args:
            vector_store: The vector store to use.
            embedder: The embedder to use.
            document_processor_router: The document processor router to use.
            processing_strategy: The processing strategy to use.
            source_resolver: The source resolver to use.
            default_options: The default options for searching.
        """
        self.vector_store = vector_store
        self.embedder = embedder
>       self.document_processor_router = document_processor_router or DocumentProcessorRouter()
E       TypeError: DocumentProcessorRouter.__init__() missing 1 required positional argument: 'providers'

packages/ragbits-document-search/src/ragbits/document_search/_main.py:96: TypeError

Check failure on line 42 in packages/ragbits-core/tests/cli/test_vector_store.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_vector_store.test_handling_document_ingestion_with_different_content_and_verifying_replacement[vector_store2]

TypeError: DocumentProcessorRouter.__init__() missing 1 required positional argument: 'providers'
Raw output
vector_store = <ragbits.core.vector_stores.qdrant.QdrantVectorStore object at 0x7f6ac4f73670>

    @pytest.mark.parametrize(
        "vector_store",
        [
            InMemoryVectorStore(),
            ChromaVectorStore(
                client=EphemeralClient(),
                index_name="test_index_name",
            ),
            QdrantVectorStore(
                client=AsyncQdrantClient(":memory:"),
                index_name="test_index_name",
            ),
        ],
    )
    async def test_handling_document_ingestion_with_different_content_and_verifying_replacement(
        vector_store: VectorStore,
    ) -> None:
        document_1_content = "This is a test sentence and it should be in the vector store"
        document_2_content = "This is another test sentence and it should be removed from the vector store"
        document_2_new_content = "This is one more test sentence and it should be added to the vector store"
    
        document_1 = DocumentMeta.create_text_document_from_literal(document_1_content)
        document_2 = DocumentMeta.create_text_document_from_literal(document_2_content)
    
        embedder = AsyncMock()
        embedder.embed_text.return_value = [[0.0], [0.0]]
>       document_search = DocumentSearch(
            embedder=embedder,
            vector_store=vector_store,
        )

packages/ragbits-core/tests/integration/vector_stores/test_vector_store.py:42: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <ragbits.document_search._main.DocumentSearch object at 0x7f6ac4fb9270>
vector_store = <ragbits.core.vector_stores.qdrant.QdrantVectorStore object at 0x7f6ac4f73670>
embedder = <AsyncMock id='140096552487136'>, document_processor_router = None
processing_strategy = None, source_resolver = None, default_options = None

    def __init__(
        self,
        vector_store: VectorStore,
        embedder: Embeddings,
        document_processor_router: DocumentProcessorRouter | None = None,
        processing_strategy: ProcessingExecutionStrategy | None = None,
        source_resolver: SourceResolver | None = None,
        default_options: DocumentSearchOptions | None = None,
    ) -> None:
        """
        Constructs a new DocumentSearch instance.
    
        Args:
            vector_store: The vector store to use.
            embedder: The embedder to use.
            document_processor_router: The document processor router to use.
            processing_strategy: The processing strategy to use.
            source_resolver: The source resolver to use.
            default_options: The default options for searching.
        """
        self.vector_store = vector_store
        self.embedder = embedder
>       self.document_processor_router = document_processor_router or DocumentProcessorRouter()
E       TypeError: DocumentProcessorRouter.__init__() missing 1 required positional argument: 'providers'

packages/ragbits-document-search/src/ragbits/document_search/_main.py:96: TypeError

Check failure on line 57 in .venv/lib/python3.10/site-packages/chromadb/test/test_chroma.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_chroma.test_store

ValueError: Entry must have embedding_type in metadata
Raw output
mock_chromadb_store = <ragbits.core.vector_stores.chroma.ChromaVectorStore object at 0x7f6abe2befe0>

    async def test_store(mock_chromadb_store: ChromaVectorStore) -> None:
        data = [
            VectorStoreEntry(
                id="test_key",
                key="test content",
                vector=[0.1, 0.2, 0.3],
                metadata={
                    "content": "test content",
                    "document": {
                        "title": "test title",
                        "source": {"path": "/test/path"},
                        "document_type": "test_type",
                    },
                },
            )
        ]
    
>       await mock_chromadb_store.store(data)

packages/ragbits-core/tests/unit/vector_stores/test_chroma.py:57: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
packages/ragbits-core/src/ragbits/core/audit/__init__.py:121: in wrapper_async
    returned = await func(*args, **kwargs)  # type: ignore
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <ragbits.core.vector_stores.chroma.ChromaVectorStore object at 0x7f6abe2befe0>
entries = [VectorStoreEntry(id='test_key', key='test content', text=None, image_bytes=None, metadata={'content': 'test content', 'document': {'title': 'test title', 'source': {'path': '/test/path'}, 'document_type': 'test_type'}})]

    @traceable
    async def store(self, entries: list[VectorStoreEntry]) -> None:
        """
        Stores entries in the ChromaDB collection.
    
        Args:
            entries: The entries to store.
        """
        if not entries:
            return
    
        ids = [entry.id for entry in entries]
        documents = [entry.key for entry in entries]
        metadatas = [entry.metadata for entry in entries]
    
        # Flatten metadata
        flattened_metadatas = [flatten_dict(metadata) for metadata in metadatas]
    
        metadatas = (
            flattened_metadatas
            if self._metadata_store is None
            else await self._metadata_store.store(ids, flattened_metadatas)  # type: ignore
        )
    
        # Group entries by embedding type
        embedding_groups: dict[str, list[tuple[str, list[float]]]] = {}
        for entry in entries:
            if "embedding_type" not in entry.metadata:
>               raise ValueError("Entry must have embedding_type in metadata")
E               ValueError: Entry must have embedding_type in metadata

packages/ragbits-core/src/ragbits/core/vector_stores/chroma.py:96: ValueError

Check failure on line 118 in .venv/lib/python3.10/site-packages/chromadb/test/test_chroma.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_chroma.test_retrieve[None-results0]

AssertionError: assert 0 == 2
 +  where 0 = len([])
 +  and   2 = len([{'content': 'test content 1', 'title': 'test title 1', 'vector': [0.12, 0.25, 0.29]}, {'content': 'test content 2', 'title': 'test title 2', 'vector': [0.13, 0.26, 0.3]}])
Raw output
mock_chromadb_store = <ragbits.core.vector_stores.chroma.ChromaVectorStore object at 0x7f6abc836590>
max_distance = None
results = [{'content': 'test content 1', 'title': 'test title 1', 'vector': [0.12, 0.25, 0.29]}, {'content': 'test content 2', 'title': 'test title 2', 'vector': [0.13, 0.26, 0.3]}]

    @pytest.mark.parametrize(
        ("max_distance", "results"),
        [
            (
                None,
                [
                    {"content": "test content 1", "title": "test title 1", "vector": [0.12, 0.25, 0.29]},
                    {"content": "test content 2", "title": "test title 2", "vector": [0.13, 0.26, 0.30]},
                ],
            ),
            (0.1, [{"content": "test content 1", "title": "test title 1", "vector": [0.12, 0.25, 0.29]}]),
            (0.09, []),
        ],
    )
    async def test_retrieve(
        mock_chromadb_store: ChromaVectorStore, max_distance: float | None, results: list[dict]
    ) -> None:
        vector = [0.1, 0.2, 0.3]
        mock_chromadb_store._collection.query.return_value = {  # type: ignore
            "metadatas": [
                [
                    {
                        "content": "test content 1",
                        "document.title": "test title 1",
                        "document.source.path": "/test/path-1",
                        "document.document_type": "txt",
                    },
                    {
                        "content": "test content 2",
                        "document.title": "test title 2",
                        "document.source.path": "/test/path-2",
                        "document.document_type": "txt",
                    },
                ]
            ],
            "embeddings": [[[0.12, 0.25, 0.29], [0.13, 0.26, 0.30]]],
            "distances": [[0.1, 0.2]],
            "documents": [["test content 1", "test content 2"]],
            "ids": [["test_id_1", "test_id_2"]],
        }
    
        entries = await mock_chromadb_store.retrieve(vector, options=VectorStoreOptions(max_distance=max_distance))
    
>       assert len(entries) == len(results)
E       AssertionError: assert 0 == 2
E        +  where 0 = len([])
E        +  and   2 = len([{'content': 'test content 1', 'title': 'test title 1', 'vector': [0.12, 0.25, 0.29]}, {'content': 'test content 2', 'title': 'test title 2', 'vector': [0.13, 0.26, 0.3]}])

packages/ragbits-core/tests/unit/vector_stores/test_chroma.py:118: AssertionError

Check failure on line 118 in .venv/lib/python3.10/site-packages/chromadb/test/test_chroma.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_chroma.test_retrieve[0.1-results1]

AssertionError: assert 0 == 1
 +  where 0 = len([])
 +  and   1 = len([{'content': 'test content 1', 'title': 'test title 1', 'vector': [0.12, 0.25, 0.29]}])
Raw output
mock_chromadb_store = <ragbits.core.vector_stores.chroma.ChromaVectorStore object at 0x7f6abc839420>
max_distance = 0.1
results = [{'content': 'test content 1', 'title': 'test title 1', 'vector': [0.12, 0.25, 0.29]}]

    @pytest.mark.parametrize(
        ("max_distance", "results"),
        [
            (
                None,
                [
                    {"content": "test content 1", "title": "test title 1", "vector": [0.12, 0.25, 0.29]},
                    {"content": "test content 2", "title": "test title 2", "vector": [0.13, 0.26, 0.30]},
                ],
            ),
            (0.1, [{"content": "test content 1", "title": "test title 1", "vector": [0.12, 0.25, 0.29]}]),
            (0.09, []),
        ],
    )
    async def test_retrieve(
        mock_chromadb_store: ChromaVectorStore, max_distance: float | None, results: list[dict]
    ) -> None:
        vector = [0.1, 0.2, 0.3]
        mock_chromadb_store._collection.query.return_value = {  # type: ignore
            "metadatas": [
                [
                    {
                        "content": "test content 1",
                        "document.title": "test title 1",
                        "document.source.path": "/test/path-1",
                        "document.document_type": "txt",
                    },
                    {
                        "content": "test content 2",
                        "document.title": "test title 2",
                        "document.source.path": "/test/path-2",
                        "document.document_type": "txt",
                    },
                ]
            ],
            "embeddings": [[[0.12, 0.25, 0.29], [0.13, 0.26, 0.30]]],
            "distances": [[0.1, 0.2]],
            "documents": [["test content 1", "test content 2"]],
            "ids": [["test_id_1", "test_id_2"]],
        }
    
        entries = await mock_chromadb_store.retrieve(vector, options=VectorStoreOptions(max_distance=max_distance))
    
>       assert len(entries) == len(results)
E       AssertionError: assert 0 == 1
E        +  where 0 = len([])
E        +  and   1 = len([{'content': 'test content 1', 'title': 'test title 1', 'vector': [0.12, 0.25, 0.29]}])

packages/ragbits-core/tests/unit/vector_stores/test_chroma.py:118: AssertionError

Check failure on line 132 in .venv/lib/python3.10/site-packages/chromadb/test/test_chroma.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_chroma.test_remove

AssertionError: Expected 'delete' to have been called once. Called 0 times.
Raw output
mock_chromadb_store = <ragbits.core.vector_stores.chroma.ChromaVectorStore object at 0x7f6abc832a70>

    async def test_remove(mock_chromadb_store: ChromaVectorStore) -> None:
        ids_to_remove = ["1c7d6b27-4ef1-537c-ad7c-676edb8bc8a8"]
    
        await mock_chromadb_store.remove(ids_to_remove)
    
>       mock_chromadb_store._client.get_or_create_collection().delete.assert_called_once()  # type: ignore

packages/ragbits-core/tests/unit/vector_stores/test_chroma.py:132: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <MagicMock name='mock.get_or_create_collection().delete' id='140096548779248'>

    def assert_called_once(self):
        """assert that the mock was called only once.
        """
        if not self.call_count == 1:
            msg = ("Expected '%s' to have been called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'delete' to have been called once. Called 0 times.

../../../.local/share/uv/python/cpython-3.10.15-linux-x86_64-gnu/lib/python3.10/unittest/mock.py:908: AssertionError

Check failure on line 159 in .venv/lib/python3.10/site-packages/chromadb/test/test_chroma.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_chroma.test_list

assert 0 == 2
 +  where 0 = len([])
Raw output
mock_chromadb_store = <ragbits.core.vector_stores.chroma.ChromaVectorStore object at 0x7f6abc8d0e20>

    async def test_list(mock_chromadb_store: ChromaVectorStore) -> None:
        mock_chromadb_store._collection.get.return_value = {  # type: ignore
            "metadatas": [
                {
                    "content": "test content",
                    "document.title": "test title",
                    "document.source.path": "/test/path",
                    "document.document_type": "test_type",
                },
                {
                    "content": "test content 2",
                    "document.title": "test title 2",
                    "document.source.path": "/test/path",
                    "document.document_type": "test_type",
                },
            ],
            "embeddings": [[0.12, 0.25, 0.29], [0.13, 0.26, 0.30]],
            "documents": ["test content 1", "test content2"],
            "ids": ["test_id_1", "test_id_2"],
        }
    
        entries = await mock_chromadb_store.list()
    
>       assert len(entries) == 2
E       assert 0 == 2
E        +  where 0 = len([])

packages/ragbits-core/tests/unit/vector_stores/test_chroma.py:159: AssertionError

Check failure on line 192 in .venv/lib/python3.10/site-packages/chromadb/test/test_chroma.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_chroma.test_metadata_roundtrip

ValueError: Entry must have embedding_type in metadata
Raw output
mock_chromadb_store = <ragbits.core.vector_stores.chroma.ChromaVectorStore object at 0x7f6abc89b0a0>

    async def test_metadata_roundtrip(mock_chromadb_store: ChromaVectorStore) -> None:
        # Prepare nested metadata structure
        original_metadata = {
            "content": "test content",
            "document": {
                "title": "test title",
                "source": {"path": "/test/path", "type": "pdf"},
                "metadata": {"author": "Test Author", "tags": ["test", "metadata"], "pages": 42},
            },
        }
    
        # Create and store entry
        input_entry = VectorStoreEntry(
            id="test_doc_1", key="test content", vector=[0.1, 0.2, 0.3], metadata=original_metadata
        )
    
        # Mock the collection's behavior for both store and retrieve
        mock_collection = mock_chromadb_store._collection
    
        # Store the entry
>       await mock_chromadb_store.store([input_entry])

packages/ragbits-core/tests/unit/vector_stores/test_chroma.py:192: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
packages/ragbits-core/src/ragbits/core/audit/__init__.py:121: in wrapper_async
    returned = await func(*args, **kwargs)  # type: ignore
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <ragbits.core.vector_stores.chroma.ChromaVectorStore object at 0x7f6abc89b0a0>
entries = [VectorStoreEntry(id='test_doc_1', key='test content', text=None, image_bytes=None, metadata={'content': 'test content...th': '/test/path', 'type': 'pdf'}, 'metadata': {'author': 'Test Author', 'tags': ['test', 'metadata'], 'pages': 42}}})]

    @traceable
    async def store(self, entries: list[VectorStoreEntry]) -> None:
        """
        Stores entries in the ChromaDB collection.
    
        Args:
            entries: The entries to store.
        """
        if not entries:
            return
    
        ids = [entry.id for entry in entries]
        documents = [entry.key for entry in entries]
        metadatas = [entry.metadata for entry in entries]
    
        # Flatten metadata
        flattened_metadatas = [flatten_dict(metadata) for metadata in metadatas]
    
        metadatas = (
            flattened_metadatas
            if self._metadata_store is None
            else await self._metadata_store.store(ids, flattened_metadatas)  # type: ignore
        )
    
        # Group entries by embedding type
        embedding_groups: dict[str, list[tuple[str, list[float]]]] = {}
        for entry in entries:
            if "embedding_type" not in entry.metadata:
>               raise ValueError("Entry must have embedding_type in metadata")
E               ValueError: Entry must have embedding_type in metadata

packages/ragbits-core/src/ragbits/core/vector_stores/chroma.py:96: ValueError

Check failure on line 17 in .venv/lib/python3.10/site-packages/chromadb/test/test_chroma.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_chroma.test_store_and_retrieve

failed on setup with "file /home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py, line 222
  async def test_store_and_retrieve(vector_store: ChromaVectorStore, entries: list[VectorStoreEntry]) -> None:
      await vector_store.store(entries)
      results = await vector_store.retrieve([1.0, 0.0])
      assert len(results) == 2
      assert results[0].entry.id == "1"
      assert results[0].entry.key == "test1"
      assert results[0].vectors["text"] == [1.0, 0.0]
      assert results[0].score == 0.0
      assert results[1].entry.id == "2"
      assert results[1].entry.key == "test2"
      assert results[1].vectors["text"] == [0.0, 1.0]
      assert results[1].score == pytest.approx(1.4142135623730951)
file /home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py, line 17
  @pytest.fixture
  def vector_store(chroma_client) -> ChromaVectorStore:
E       fixture 'chroma_client' not found
>       available fixtures: _session_event_loop, anyio_backend, anyio_backend_name, anyio_backend_options, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, entries, event_loop, event_loop_policy, hydra_restore_singletons, hydra_sweep_runner, hydra_task_runner, mock_chromadb_store, monkeypatch, no_cover, packages/ragbits-core/tests/unit/vector_stores/test_chroma.py::<event_loop>, packages/ragbits-core/tests/unit/vector_stores::<event_loop>, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, unused_tcp_port, unused_tcp_port_factory, unused_udp_port, unused_udp_port_factory, vector_store
>       use 'pytest --fixtures [testpath]' for help on them.

/home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py:17"
Raw output
file /home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py, line 222
  async def test_store_and_retrieve(vector_store: ChromaVectorStore, entries: list[VectorStoreEntry]) -> None:
      await vector_store.store(entries)
      results = await vector_store.retrieve([1.0, 0.0])
      assert len(results) == 2
      assert results[0].entry.id == "1"
      assert results[0].entry.key == "test1"
      assert results[0].vectors["text"] == [1.0, 0.0]
      assert results[0].score == 0.0
      assert results[1].entry.id == "2"
      assert results[1].entry.key == "test2"
      assert results[1].vectors["text"] == [0.0, 1.0]
      assert results[1].score == pytest.approx(1.4142135623730951)
file /home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py, line 17
  @pytest.fixture
  def vector_store(chroma_client) -> ChromaVectorStore:
E       fixture 'chroma_client' not found
>       available fixtures: _session_event_loop, anyio_backend, anyio_backend_name, anyio_backend_options, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, entries, event_loop, event_loop_policy, hydra_restore_singletons, hydra_sweep_runner, hydra_task_runner, mock_chromadb_store, monkeypatch, no_cover, packages/ragbits-core/tests/unit/vector_stores/test_chroma.py::<event_loop>, packages/ragbits-core/tests/unit/vector_stores::<event_loop>, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, unused_tcp_port, unused_tcp_port_factory, unused_udp_port, unused_udp_port_factory, vector_store
>       use 'pytest --fixtures [testpath]' for help on them.

/home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py:17

Check failure on line 17 in .venv/lib/python3.10/site-packages/chromadb/test/test_chroma.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_chroma.test_store_and_retrieve_with_max_distance

failed on setup with "file /home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py, line 236
  async def test_store_and_retrieve_with_max_distance(
      vector_store: ChromaVectorStore, entries: list[VectorStoreEntry]
  ) -> None:
      await vector_store.store(entries)
      results = await vector_store.retrieve([1.0, 0.0], options=vector_store.options_cls(max_distance=1.0))
      assert len(results) == 1
      assert results[0].entry.id == "1"
      assert results[0].entry.key == "test1"
      assert results[0].vectors["text"] == [1.0, 0.0]
      assert results[0].score == 0.0
file /home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py, line 17
  @pytest.fixture
  def vector_store(chroma_client) -> ChromaVectorStore:
E       fixture 'chroma_client' not found
>       available fixtures: _session_event_loop, anyio_backend, anyio_backend_name, anyio_backend_options, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, entries, event_loop, event_loop_policy, hydra_restore_singletons, hydra_sweep_runner, hydra_task_runner, mock_chromadb_store, monkeypatch, no_cover, packages/ragbits-core/tests/unit/vector_stores/test_chroma.py::<event_loop>, packages/ragbits-core/tests/unit/vector_stores::<event_loop>, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, unused_tcp_port, unused_tcp_port_factory, unused_udp_port, unused_udp_port_factory, vector_store
>       use 'pytest --fixtures [testpath]' for help on them.

/home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py:17"
Raw output
file /home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py, line 236
  async def test_store_and_retrieve_with_max_distance(
      vector_store: ChromaVectorStore, entries: list[VectorStoreEntry]
  ) -> None:
      await vector_store.store(entries)
      results = await vector_store.retrieve([1.0, 0.0], options=vector_store.options_cls(max_distance=1.0))
      assert len(results) == 1
      assert results[0].entry.id == "1"
      assert results[0].entry.key == "test1"
      assert results[0].vectors["text"] == [1.0, 0.0]
      assert results[0].score == 0.0
file /home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py, line 17
  @pytest.fixture
  def vector_store(chroma_client) -> ChromaVectorStore:
E       fixture 'chroma_client' not found
>       available fixtures: _session_event_loop, anyio_backend, anyio_backend_name, anyio_backend_options, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, entries, event_loop, event_loop_policy, hydra_restore_singletons, hydra_sweep_runner, hydra_task_runner, mock_chromadb_store, monkeypatch, no_cover, packages/ragbits-core/tests/unit/vector_stores/test_chroma.py::<event_loop>, packages/ragbits-core/tests/unit/vector_stores::<event_loop>, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, unused_tcp_port, unused_tcp_port_factory, unused_udp_port, unused_udp_port_factory, vector_store
>       use 'pytest --fixtures [testpath]' for help on them.

/home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py:17

Check failure on line 17 in .venv/lib/python3.10/site-packages/chromadb/test/test_chroma.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_chroma.test_store_and_retrieve_with_k

failed on setup with "file /home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py, line 248
  async def test_store_and_retrieve_with_k(vector_store: ChromaVectorStore, entries: list[VectorStoreEntry]) -> None:
      await vector_store.store(entries)
      results = await vector_store.retrieve([1.0, 0.0], options=vector_store.options_cls(k=1))
      assert len(results) == 1
      assert results[0].entry.id == "1"
      assert results[0].entry.key == "test1"
      assert results[0].vectors["text"] == [1.0, 0.0]
      assert results[0].score == 0.0
file /home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py, line 17
  @pytest.fixture
  def vector_store(chroma_client) -> ChromaVectorStore:
E       fixture 'chroma_client' not found
>       available fixtures: _session_event_loop, anyio_backend, anyio_backend_name, anyio_backend_options, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, entries, event_loop, event_loop_policy, hydra_restore_singletons, hydra_sweep_runner, hydra_task_runner, mock_chromadb_store, monkeypatch, no_cover, packages/ragbits-core/tests/unit/vector_stores/test_chroma.py::<event_loop>, packages/ragbits-core/tests/unit/vector_stores::<event_loop>, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, unused_tcp_port, unused_tcp_port_factory, unused_udp_port, unused_udp_port_factory, vector_store
>       use 'pytest --fixtures [testpath]' for help on them.

/home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py:17"
Raw output
file /home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py, line 248
  async def test_store_and_retrieve_with_k(vector_store: ChromaVectorStore, entries: list[VectorStoreEntry]) -> None:
      await vector_store.store(entries)
      results = await vector_store.retrieve([1.0, 0.0], options=vector_store.options_cls(k=1))
      assert len(results) == 1
      assert results[0].entry.id == "1"
      assert results[0].entry.key == "test1"
      assert results[0].vectors["text"] == [1.0, 0.0]
      assert results[0].score == 0.0
file /home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py, line 17
  @pytest.fixture
  def vector_store(chroma_client) -> ChromaVectorStore:
E       fixture 'chroma_client' not found
>       available fixtures: _session_event_loop, anyio_backend, anyio_backend_name, anyio_backend_options, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, entries, event_loop, event_loop_policy, hydra_restore_singletons, hydra_sweep_runner, hydra_task_runner, mock_chromadb_store, monkeypatch, no_cover, packages/ragbits-core/tests/unit/vector_stores/test_chroma.py::<event_loop>, packages/ragbits-core/tests/unit/vector_stores::<event_loop>, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, unused_tcp_port, unused_tcp_port_factory, unused_udp_port, unused_udp_port_factory, vector_store
>       use 'pytest --fixtures [testpath]' for help on them.

/home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py:17

Check failure on line 17 in .venv/lib/python3.10/site-packages/chromadb/test/test_chroma.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_chroma.test_store_and_list

failed on setup with "file /home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py, line 258
  async def test_store_and_list(vector_store: ChromaVectorStore, entries: list[VectorStoreEntry]) -> None:
      await vector_store.store(entries)
      results = await vector_store.list()
      assert len(results) == 2
      assert results[0].id == "1"
      assert results[0].key == "test1"
      assert results[1].id == "2"
      assert results[1].key == "test2"
file /home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py, line 17
  @pytest.fixture
  def vector_store(chroma_client) -> ChromaVectorStore:
E       fixture 'chroma_client' not found
>       available fixtures: _session_event_loop, anyio_backend, anyio_backend_name, anyio_backend_options, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, entries, event_loop, event_loop_policy, hydra_restore_singletons, hydra_sweep_runner, hydra_task_runner, mock_chromadb_store, monkeypatch, no_cover, packages/ragbits-core/tests/unit/vector_stores/test_chroma.py::<event_loop>, packages/ragbits-core/tests/unit/vector_stores::<event_loop>, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, unused_tcp_port, unused_tcp_port_factory, unused_udp_port, unused_udp_port_factory, vector_store
>       use 'pytest --fixtures [testpath]' for help on them.

/home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py:17"
Raw output
file /home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py, line 258
  async def test_store_and_list(vector_store: ChromaVectorStore, entries: list[VectorStoreEntry]) -> None:
      await vector_store.store(entries)
      results = await vector_store.list()
      assert len(results) == 2
      assert results[0].id == "1"
      assert results[0].key == "test1"
      assert results[1].id == "2"
      assert results[1].key == "test2"
file /home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py, line 17
  @pytest.fixture
  def vector_store(chroma_client) -> ChromaVectorStore:
E       fixture 'chroma_client' not found
>       available fixtures: _session_event_loop, anyio_backend, anyio_backend_name, anyio_backend_options, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, entries, event_loop, event_loop_policy, hydra_restore_singletons, hydra_sweep_runner, hydra_task_runner, mock_chromadb_store, monkeypatch, no_cover, packages/ragbits-core/tests/unit/vector_stores/test_chroma.py::<event_loop>, packages/ragbits-core/tests/unit/vector_stores::<event_loop>, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, unused_tcp_port, unused_tcp_port_factory, unused_udp_port, unused_udp_port_factory, vector_store
>       use 'pytest --fixtures [testpath]' for help on them.

/home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py:17

Check failure on line 17 in .venv/lib/python3.10/site-packages/chromadb/test/test_chroma.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_chroma.test_store_and_list_with_limit

failed on setup with "file /home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py, line 268
  async def test_store_and_list_with_limit(vector_store: ChromaVectorStore, entries: list[VectorStoreEntry]) -> None:
      await vector_store.store(entries)
      results = await vector_store.list(limit=1)
      assert len(results) == 1
      assert results[0].id == "1"
      assert results[0].key == "test1"
file /home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py, line 17
  @pytest.fixture
  def vector_store(chroma_client) -> ChromaVectorStore:
E       fixture 'chroma_client' not found
>       available fixtures: _session_event_loop, anyio_backend, anyio_backend_name, anyio_backend_options, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, entries, event_loop, event_loop_policy, hydra_restore_singletons, hydra_sweep_runner, hydra_task_runner, mock_chromadb_store, monkeypatch, no_cover, packages/ragbits-core/tests/unit/vector_stores/test_chroma.py::<event_loop>, packages/ragbits-core/tests/unit/vector_stores::<event_loop>, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, unused_tcp_port, unused_tcp_port_factory, unused_udp_port, unused_udp_port_factory, vector_store
>       use 'pytest --fixtures [testpath]' for help on them.

/home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py:17"
Raw output
file /home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py, line 268
  async def test_store_and_list_with_limit(vector_store: ChromaVectorStore, entries: list[VectorStoreEntry]) -> None:
      await vector_store.store(entries)
      results = await vector_store.list(limit=1)
      assert len(results) == 1
      assert results[0].id == "1"
      assert results[0].key == "test1"
file /home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py, line 17
  @pytest.fixture
  def vector_store(chroma_client) -> ChromaVectorStore:
E       fixture 'chroma_client' not found
>       available fixtures: _session_event_loop, anyio_backend, anyio_backend_name, anyio_backend_options, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, entries, event_loop, event_loop_policy, hydra_restore_singletons, hydra_sweep_runner, hydra_task_runner, mock_chromadb_store, monkeypatch, no_cover, packages/ragbits-core/tests/unit/vector_stores/test_chroma.py::<event_loop>, packages/ragbits-core/tests/unit/vector_stores::<event_loop>, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, unused_tcp_port, unused_tcp_port_factory, unused_udp_port, unused_udp_port_factory, vector_store
>       use 'pytest --fixtures [testpath]' for help on them.

/home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py:17

Check failure on line 17 in .venv/lib/python3.10/site-packages/chromadb/test/test_chroma.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_chroma.test_store_and_list_with_offset

failed on setup with "file /home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py, line 276
  async def test_store_and_list_with_offset(vector_store: ChromaVectorStore, entries: list[VectorStoreEntry]) -> None:
      await vector_store.store(entries)
      results = await vector_store.list(offset=1)
      assert len(results) == 1
      assert results[0].id == "2"
      assert results[0].key == "test2"
file /home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py, line 17
  @pytest.fixture
  def vector_store(chroma_client) -> ChromaVectorStore:
E       fixture 'chroma_client' not found
>       available fixtures: _session_event_loop, anyio_backend, anyio_backend_name, anyio_backend_options, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, entries, event_loop, event_loop_policy, hydra_restore_singletons, hydra_sweep_runner, hydra_task_runner, mock_chromadb_store, monkeypatch, no_cover, packages/ragbits-core/tests/unit/vector_stores/test_chroma.py::<event_loop>, packages/ragbits-core/tests/unit/vector_stores::<event_loop>, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, unused_tcp_port, unused_tcp_port_factory, unused_udp_port, unused_udp_port_factory, vector_store
>       use 'pytest --fixtures [testpath]' for help on them.

/home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py:17"
Raw output
file /home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py, line 276
  async def test_store_and_list_with_offset(vector_store: ChromaVectorStore, entries: list[VectorStoreEntry]) -> None:
      await vector_store.store(entries)
      results = await vector_store.list(offset=1)
      assert len(results) == 1
      assert results[0].id == "2"
      assert results[0].key == "test2"
file /home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py, line 17
  @pytest.fixture
  def vector_store(chroma_client) -> ChromaVectorStore:
E       fixture 'chroma_client' not found
>       available fixtures: _session_event_loop, anyio_backend, anyio_backend_name, anyio_backend_options, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, entries, event_loop, event_loop_policy, hydra_restore_singletons, hydra_sweep_runner, hydra_task_runner, mock_chromadb_store, monkeypatch, no_cover, packages/ragbits-core/tests/unit/vector_stores/test_chroma.py::<event_loop>, packages/ragbits-core/tests/unit/vector_stores::<event_loop>, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, unused_tcp_port, unused_tcp_port_factory, unused_udp_port, unused_udp_port_factory, vector_store
>       use 'pytest --fixtures [testpath]' for help on them.

/home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py:17

Check failure on line 17 in .venv/lib/python3.10/site-packages/chromadb/test/test_chroma.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_chroma.test_store_and_list_with_where

failed on setup with "file /home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py, line 284
  async def test_store_and_list_with_where(vector_store: ChromaVectorStore, entries: list[VectorStoreEntry]) -> None:
      await vector_store.store(entries)
      results = await vector_store.list(where={"embedding_type": "text"})
      assert len(results) == 2
      assert results[0].id == "1"
      assert results[0].key == "test1"
      assert results[1].id == "2"
      assert results[1].key == "test2"
file /home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py, line 17
  @pytest.fixture
  def vector_store(chroma_client) -> ChromaVectorStore:
E       fixture 'chroma_client' not found
>       available fixtures: _session_event_loop, anyio_backend, anyio_backend_name, anyio_backend_options, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, entries, event_loop, event_loop_policy, hydra_restore_singletons, hydra_sweep_runner, hydra_task_runner, mock_chromadb_store, monkeypatch, no_cover, packages/ragbits-core/tests/unit/vector_stores/test_chroma.py::<event_loop>, packages/ragbits-core/tests/unit/vector_stores::<event_loop>, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, unused_tcp_port, unused_tcp_port_factory, unused_udp_port, unused_udp_port_factory, vector_store
>       use 'pytest --fixtures [testpath]' for help on them.

/home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py:17"
Raw output
file /home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py, line 284
  async def test_store_and_list_with_where(vector_store: ChromaVectorStore, entries: list[VectorStoreEntry]) -> None:
      await vector_store.store(entries)
      results = await vector_store.list(where={"embedding_type": "text"})
      assert len(results) == 2
      assert results[0].id == "1"
      assert results[0].key == "test1"
      assert results[1].id == "2"
      assert results[1].key == "test2"
file /home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py, line 17
  @pytest.fixture
  def vector_store(chroma_client) -> ChromaVectorStore:
E       fixture 'chroma_client' not found
>       available fixtures: _session_event_loop, anyio_backend, anyio_backend_name, anyio_backend_options, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, entries, event_loop, event_loop_policy, hydra_restore_singletons, hydra_sweep_runner, hydra_task_runner, mock_chromadb_store, monkeypatch, no_cover, packages/ragbits-core/tests/unit/vector_stores/test_chroma.py::<event_loop>, packages/ragbits-core/tests/unit/vector_stores::<event_loop>, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, unused_tcp_port, unused_tcp_port_factory, unused_udp_port, unused_udp_port_factory, vector_store
>       use 'pytest --fixtures [testpath]' for help on them.

/home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py:17

Check failure on line 17 in .venv/lib/python3.10/site-packages/chromadb/test/test_chroma.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_chroma.test_store_and_remove

failed on setup with "file /home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py, line 294
  async def test_store_and_remove(vector_store: ChromaVectorStore, entries: list[VectorStoreEntry]) -> None:
      await vector_store.store(entries)
      await vector_store.remove(["1"])
      results = await vector_store.list()
      assert len(results) == 1
      assert results[0].id == "2"
      assert results[0].key == "test2"
file /home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py, line 17
  @pytest.fixture
  def vector_store(chroma_client) -> ChromaVectorStore:
E       fixture 'chroma_client' not found
>       available fixtures: _session_event_loop, anyio_backend, anyio_backend_name, anyio_backend_options, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, entries, event_loop, event_loop_policy, hydra_restore_singletons, hydra_sweep_runner, hydra_task_runner, mock_chromadb_store, monkeypatch, no_cover, packages/ragbits-core/tests/unit/vector_stores/test_chroma.py::<event_loop>, packages/ragbits-core/tests/unit/vector_stores::<event_loop>, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, unused_tcp_port, unused_tcp_port_factory, unused_udp_port, unused_udp_port_factory, vector_store
>       use 'pytest --fixtures [testpath]' for help on them.

/home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py:17"
Raw output
file /home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py, line 294
  async def test_store_and_remove(vector_store: ChromaVectorStore, entries: list[VectorStoreEntry]) -> None:
      await vector_store.store(entries)
      await vector_store.remove(["1"])
      results = await vector_store.list()
      assert len(results) == 1
      assert results[0].id == "2"
      assert results[0].key == "test2"
file /home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py, line 17
  @pytest.fixture
  def vector_store(chroma_client) -> ChromaVectorStore:
E       fixture 'chroma_client' not found
>       available fixtures: _session_event_loop, anyio_backend, anyio_backend_name, anyio_backend_options, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, entries, event_loop, event_loop_policy, hydra_restore_singletons, hydra_sweep_runner, hydra_task_runner, mock_chromadb_store, monkeypatch, no_cover, packages/ragbits-core/tests/unit/vector_stores/test_chroma.py::<event_loop>, packages/ragbits-core/tests/unit/vector_stores::<event_loop>, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, unused_tcp_port, unused_tcp_port_factory, unused_udp_port, unused_udp_port_factory, vector_store
>       use 'pytest --fixtures [testpath]' for help on them.

/home/runner/work/ragbits/ragbits/packages/ragbits-core/tests/unit/vector_stores/test_chroma.py:17

Check failure on line 180 in packages/ragbits-core/tests/unit/metadata_stores/test_in_memory.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_in_memory.test_retrieve[5-None-results0]

AttributeError: 'VectorStoreResult' object has no attribute 'metadata'
Raw output
store = <ragbits.core.vector_stores.in_memory.InMemoryVectorStore object at 0x7f6abc8d20b0>
k = 5, max_distance = None
results = ['spikey', 'fluffy', 'slimy', 'spotty', 'scaly']

    @pytest.mark.parametrize(
        ("k", "max_distance", "results"),
        [
            (5, None, ["spikey", "fluffy", "slimy", "spotty", "scaly"]),
            (2, None, ["spikey", "fluffy"]),
            (5, 0.3, ["spikey", "fluffy"]),
        ],
    )
    async def test_retrieve(store: InMemoryVectorStore, k: int, max_distance: float | None, results: list[str]) -> None:
        search_vector = [0.4, 0.4]
    
        entries = await store.retrieve(search_vector, options=VectorStoreOptions(k=k, max_distance=max_distance))
    
        assert len(entries) == len(results)
        for entry, result in zip(entries, results, strict=True):
>           assert entry.metadata["name"] == result

packages/ragbits-core/tests/unit/vector_stores/test_in_memory.py:180: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = VectorStoreResult(entry=VectorStoreEntry(id='426829c5-df55-5cf0-b363-276ac9fe6524', key='spikey', text='spikey', image...ikey', 'embedding_type': 'EmbeddingType.TEXT'}), vectors={'EmbeddingType.TEXT': [0.5, 0.5]}, score=0.14142135623730948)
item = 'metadata'

    def __getattr__(self, item: str) -> Any:
        private_attributes = object.__getattribute__(self, '__private_attributes__')
        if item in private_attributes:
            attribute = private_attributes[item]
            if hasattr(attribute, '__get__'):
                return attribute.__get__(self, type(self))  # type: ignore
    
            try:
                # Note: self.__pydantic_private__ cannot be None if self.__private_attributes__ has items
                return self.__pydantic_private__[item]  # type: ignore
            except KeyError as exc:
                raise AttributeError(f'{type(self).__name__!r} object has no attribute {item!r}') from exc
        else:
            # `__pydantic_extra__` can fail to be set if the model is not yet fully initialized.
            # See `BaseModel.__repr_args__` for more details
            try:
                pydantic_extra = object.__getattribute__(self, '__pydantic_extra__')
            except AttributeError:
                pydantic_extra = None
    
            if pydantic_extra:
                try:
                    return pydantic_extra[item]
                except KeyError as exc:
                    raise AttributeError(f'{type(self).__name__!r} object has no attribute {item!r}') from exc
            else:
                if hasattr(self.__class__, item):
                    return super().__getattribute__(item)  # Raises AttributeError if appropriate
                else:
                    # this is the current error
>                   raise AttributeError(f'{type(self).__name__!r} object has no attribute {item!r}')
E                   AttributeError: 'VectorStoreResult' object has no attribute 'metadata'

.venv/lib/python3.10/site-packages/pydantic/main.py:856: AttributeError