Skip to content

Instantly share code, notes, and snippets.

@sarahec
Last active October 1, 2024 21:45
Show Gist options
  • Save sarahec/74e1bef7f170ba1ee37cb42f6499124e to your computer and use it in GitHub Desktop.
Save sarahec/74e1bef7f170ba1ee37cb42f6499124e to your computer and use it in GitHub Desktop.
Build log for python312Packages.langchain-chroma after updating chromadb to 0.5.11 -- aarch64-Darwin 10.5 (Sierra)
Sourcing python-remove-tests-dir-hook
Sourcing python-catch-conflicts-hook.sh
Sourcing python-remove-bin-bytecode-hook.sh
Sourcing pypa-build-hook
Using pypaBuildPhase
Sourcing python-runtime-deps-check-hook
Using pythonRuntimeDepsCheckHook
Sourcing pypa-install-hook
Using pypaInstallPhase
Sourcing python-imports-check-hook.sh
Using pythonImportsCheckPhase
Sourcing python-namespaces-hook
Sourcing python-catch-conflicts-hook.sh
Sourcing pytest-check-hook
Using pytestCheckPhase
Running phase: unpackPhase
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking source archive /nix/store/ja1sg78nshlwrwxcngyhi62i36xdxqdy-source
source root is source/libs/partners/chroma
setting SOURCE_DATE_EPOCH to timestamp 315619200 of file source/libs/partners/chroma/tests/unit_tests/test_vectorstores.py
Running phase: patchPhase
@nix { "action": "setPhase", "phase": "patchPhase" }
Running phase: updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Running phase: configurePhase
@nix { "action": "setPhase", "phase": "configurePhase" }
no configure script, doing nothing
Running phase: buildPhase
@nix { "action": "setPhase", "phase": "buildPhase" }
Executing pypaBuildPhase
Creating a wheel...
* Getting build dependencies for wheel...
* Building wheel...
Successfully built langchain_chroma-0.1.4-py3-none-any.whl
Finished creating a wheel...
/private/tmp/nix-build-python3.11-langchain-chroma-0.1.4.drv-0/source/libs/partners/chroma/dist /private/tmp/nix-build-python3.11-langchain-chroma-0.1.4.drv-0/source/libs/partners/chroma
Unpacking to: unpacked/langchain_chroma-0.1.4...OK
Repacking wheel as ./langchain_chroma-0.1.4-py3-none-any.whl...OK
/private/tmp/nix-build-python3.11-langchain-chroma-0.1.4.drv-0/source/libs/partners/chroma
Finished executing pypaBuildPhase
Running phase: pythonRuntimeDepsCheckHook
@nix { "action": "setPhase", "phase": "pythonRuntimeDepsCheckHook" }
Executing pythonRuntimeDepsCheck
Checking runtime dependencies for langchain_chroma-0.1.4-py3-none-any.whl
Finished executing pythonRuntimeDepsCheck
Running phase: installPhase
@nix { "action": "setPhase", "phase": "installPhase" }
Executing pypaInstallPhase
Successfully installed langchain_chroma-0.1.4-py3-none-any.whl
Finished executing pypaInstallPhase
Running phase: pythonOutputDistPhase
@nix { "action": "setPhase", "phase": "pythonOutputDistPhase" }
Executing pythonOutputDistPhase
Finished executing pythonOutputDistPhase
Running phase: fixupPhase
@nix { "action": "setPhase", "phase": "fixupPhase" }
checking for references to /private/tmp/nix-build-python3.11-langchain-chroma-0.1.4.drv-0/ in /nix/store/52rkn8bc21pxrdgm55p2qz2mqlprhzgi-python3.11-langchain-chroma-0.1.4...
patching script interpreter paths in /nix/store/52rkn8bc21pxrdgm55p2qz2mqlprhzgi-python3.11-langchain-chroma-0.1.4
stripping (with command strip and flags -S) in /nix/store/52rkn8bc21pxrdgm55p2qz2mqlprhzgi-python3.11-langchain-chroma-0.1.4/lib
checking for references to /private/tmp/nix-build-python3.11-langchain-chroma-0.1.4.drv-0/ in /nix/store/i2mp4p5044l3ypnbmhmz8irp9hymrw14-python3.11-langchain-chroma-0.1.4-dist...
patching script interpreter paths in /nix/store/i2mp4p5044l3ypnbmhmz8irp9hymrw14-python3.11-langchain-chroma-0.1.4-dist
Executing pythonRemoveTestsDir
Finished executing pythonRemoveTestsDir
Running phase: installCheckPhase
@nix { "action": "setPhase", "phase": "installCheckPhase" }
no Makefile or custom installCheckPhase, doing nothing
Running phase: pythonCatchConflictsPhase
@nix { "action": "setPhase", "phase": "pythonCatchConflictsPhase" }
Running phase: pythonRemoveBinBytecodePhase
@nix { "action": "setPhase", "phase": "pythonRemoveBinBytecodePhase" }
Running phase: pythonImportsCheckPhase
@nix { "action": "setPhase", "phase": "pythonImportsCheckPhase" }
Executing pythonImportsCheckPhase
Check whether the following modules can be imported: langchain_chroma
Running phase: pytestCheckPhase
@nix { "action": "setPhase", "phase": "pytestCheckPhase" }
Executing pytestCheckPhase
============================= test session starts ==============================
platform darwin -- Python 3.11.9, pytest-8.3.2, pluggy-1.5.0
rootdir: /private/tmp/nix-build-python3.11-langchain-chroma-0.1.4.drv-0/source/libs/partners/chroma
configfile: pyproject.toml
plugins: anyio-4.4.0
collecting ... 
collecting 28 items 
collected 30 items 
tests/integration_tests/test_compile.py . [ 3%]
tests/integration_tests/test_vectorstores.py .s.........F.....sss....... [ 93%]
 [ 93%]
tests/unit_tests/test_imports.py . [ 96%]
tests/unit_tests/test_vectorstores.py . [100%]
=================================== FAILURES ===================================
_________________________ test_chroma_update_document __________________________
def test_chroma_update_document() -> None:
 """Test the update_document function in the Chroma class."""
# Make a consistent embedding
embedding = ConsistentFakeEmbeddings()

# Initial document content and id
initial_content = "foo"
document_id = "doc1"

# Create an instance of Document with initial content and metadata
original_doc = Document(page_content=initial_content, metadata={"page": "0"})

# Initialize a Chroma instance with the original document
docsearch = Chroma.from_documents(
collection_name="test_collection",
documents=[original_doc],
embedding=embedding,
ids=[document_id],
)
old_embedding = docsearch._collection.peek()["embeddings"][ # type: ignore
docsearch._collection.peek()["ids"].index(document_id)
]

# Define updated content for the document
updated_content = "updated foo"

# Create a new Document instance with the updated content and the same id
updated_doc = Document(page_content=updated_content, metadata={"page": "0"})

# Update the document in the Chroma instance
docsearch.update_document(document_id=document_id, document=updated_doc)

# Perform a similarity search with the updated content
output = docsearch.similarity_search(updated_content, k=1)

# Assert that the new embedding is correct
new_embedding = docsearch._collection.peek()["embeddings"][ # type: ignore
docsearch._collection.peek()["ids"].index(document_id)
]

docsearch.delete_collection()

# Assert that the updated document is returned by the search
assert output == [Document(page_content=updated_content, metadata={"page": "0"})]

> assert new_embedding == embedding.embed_documents([updated_content])[0]
E ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
tests/integration_tests/test_vectorstores.py:257: ValueError
=============================== warnings summary ===============================
tests/integration_tests/test_vectorstores.py::test_chroma_async
/nix/store/n41jwprvlfb06lj9sl2g03c7sc8cjvjc-python3.11-pytest-8.3.2/lib/python3.11/site-packages/_pytest/python.py:148: PytestUnhandledCoroutineWarning: async def functions are not natively supported and have been skipped.
You need to install a suitable plugin for your async framework, for example:
- anyio
- pytest-asyncio
- pytest-tornasync
- pytest-trio
- pytest-twisted
warnings.warn(PytestUnhandledCoroutineWarning(msg.format(nodeid)))
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
============================= slowest 5 durations ==============================
0.09s call tests/integration_tests/test_vectorstores.py::test_chroma
0.03s call tests/integration_tests/test_vectorstores.py::test_chroma_with_persistence
0.01s call tests/integration_tests/test_vectorstores.py::test_chroma_update_document
(2 durations < 0.005s hidden. Use -vv to show these durations.)
=========================== short test summary info ============================
FAILED tests/integration_tests/test_vectorstores.py::test_chroma_update_document - ValueError: The truth value of an array with more than one element is ambig...
============== 1 failed, 25 passed, 4 skipped, 1 warning in 0.98s ==============
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment