Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LangSmith Log Anomaly: ValidationError none is not an allowed value #285

Closed
davidgxue opened this issue Jan 25, 2024 · 0 comments · Fixed by #307
Closed

LangSmith Log Anomaly: ValidationError none is not an allowed value #285

davidgxue opened this issue Jan 25, 2024 · 0 comments · Fixed by #307
Assignees
Labels
bug Something isn't working
Milestone

Comments

@davidgxue
Copy link
Contributor

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

@davidgxue davidgxue added the bug Something isn't working label Jan 25, 2024
@davidgxue davidgxue added this to the 0.3.0 milestone Jan 25, 2024
@davidgxue davidgxue self-assigned this Jan 25, 2024
@davidgxue davidgxue removed this from the 0.3.0 milestone Jan 26, 2024
@davidgxue davidgxue added this to the 0.3.0 milestone Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant