astronomer/ask-astro

LangSmith Log Anomaly: ValidationError none is not an allowed value

Closed this issue · 0 comments

Describe the bug
Saw recurrence of the error ValidationError none is not an allowed value after 0.2.0 release.

Example Log

ValidationError(model='Document', errors=[{'loc': ('page_content',), 'msg': 'none is not an allowed value', 'type': 'type_error.none.not_allowed'}])Traceback (most recent call last):


  File "/app/.venv/lib/python3.11/site-packages/langchain/chains/base.py", line 306, in __call__
    self._call(inputs, run_manager=run_manager)


  File "/app/.venv/lib/python3.11/site-packages/langchain/chains/conversational_retrieval/base.py", line 155, in _call
    docs = self._get_docs(new_question, inputs, run_manager=_run_manager)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


  File "/app/.venv/lib/python3.11/site-packages/langchain/chains/conversational_retrieval/base.py", line 317, in _get_docs
    docs = self.retriever.get_relevant_documents(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


  File "/app/.venv/lib/python3.11/site-packages/langchain_core/retrievers.py", line 211, in get_relevant_documents
    raise e


  File "/app/.venv/lib/python3.11/site-packages/langchain_core/retrievers.py", line 204, in get_relevant_documents
    result = self._get_relevant_documents(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


  File "/app/.venv/lib/python3.11/site-packages/langchain/retrievers/contextual_compression.py", line 44, in _get_relevant_documents
    docs = self.base_retriever.get_relevant_documents(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


  File "/app/.venv/lib/python3.11/site-packages/langchain_core/retrievers.py", line 211, in get_relevant_documents
    raise e


  File "/app/.venv/lib/python3.11/site-packages/langchain_core/retrievers.py", line 204, in get_relevant_documents
    result = self._get_relevant_documents(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


  File "/app/.venv/lib/python3.11/site-packages/langchain/retrievers/contextual_compression.py", line 44, in _get_relevant_documents
    docs = self.base_retriever.get_relevant_documents(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


  File "/app/.venv/lib/python3.11/site-packages/langchain_core/retrievers.py", line 211, in get_relevant_documents
    raise e


  File "/app/.venv/lib/python3.11/site-packages/langchain_core/retrievers.py", line 204, in get_relevant_documents
    result = self._get_relevant_documents(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


  File "/app/.venv/lib/python3.11/site-packages/langchain/retrievers/multi_query.py", line 175, in _get_relevant_documents
    documents = self.retrieve_documents(queries, run_manager)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


  File "/app/.venv/lib/python3.11/site-packages/langchain/retrievers/multi_query.py", line 210, in retrieve_documents
    docs = self.retriever.get_relevant_documents(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


  File "/app/.venv/lib/python3.11/site-packages/langchain_core/retrievers.py", line 211, in get_relevant_documents
    raise e


  File "/app/.venv/lib/python3.11/site-packages/langchain_core/retrievers.py", line 204, in get_relevant_documents
    result = self._get_relevant_documents(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


  File "/app/.venv/lib/python3.11/site-packages/langchain_community/retrievers/weaviate_hybrid_search.py", line 161, in _get_relevant_documents
    docs.append(Document(page_content=text, metadata=res))
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


  File "/app/.venv/lib/python3.11/site-packages/langchain_core/load/serializable.py", line 107, in __init__
    super().__init__(**kwargs)


  File "/app/.venv/lib/python3.11/site-packages/pydantic/v1/main.py", line 341, in __init__
    raise validation_error


pydantic.v1.error_wrappers.ValidationError: 1 validation error for Document
page_content
  none is not an allowed value (type=type_error.none.not_allowed)

To Reproduce
Examples in LangSmith: https://smith.langchain.com/o/4942ae8b-e5be-4964-bb1f-7544886fa06d/projects/p/421b4053-56ab-4704-a77d-33c374e4eac1?columnVisibilityModel=%7B%22outputs%22%3Afalse%2C%22feedback_stats%22%3Atrue%2C%22reference_example%22%3Afalse%2C%22first_token_time%22%3Afalse%2C%22tags%22%3Afalse%2C%22metadata%22%3Afalse%7D&timeModel=%7B%22duration%22%3A%227d%22%7D&peek=accb37fa-6dc6-46f7-bf3c-79daf88e2d97

Expected behavior

Should not error out