Skip to content

Commit

Permalink
ci: ensure type ignores in langchain tests run across all versions of…
Browse files Browse the repository at this point in the history
… langchain (#460)

The issue is that our type ignores are required on the old version of LangChain, but not required on the new version of LangChain. If we include the type ignore, the new version of LangChain complains about an usused type ignore. Found the solution [here](python/mypy#8823 (comment)).
  • Loading branch information
axiomofjoy authored May 14, 2024
1 parent 8306ff2 commit 3aa9ef6
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -533,9 +533,9 @@ def test_chain_metadata(
# We will test that these variables do not overwrite the passed variables
prompt_template_variables=prompt_template_variables,
):
llm.predict(**langchain_prompt_variables) # type: ignore
llm.predict(**langchain_prompt_variables) # type: ignore[arg-type,unused-ignore]
else:
llm.predict(**langchain_prompt_variables) # type: ignore
llm.predict(**langchain_prompt_variables) # type: ignore[arg-type,unused-ignore]
spans = in_memory_span_exporter.get_finished_spans()
spans_by_name = {span.name: span for span in spans}

Expand Down Expand Up @@ -658,9 +658,9 @@ def test_read_session_from_metadata(
# We will test that these variables do not overwrite the passed variables
prompt_template_variables=prompt_template_variables,
):
llm.predict(**langchain_prompt_variables) # type: ignore
llm.predict(**langchain_prompt_variables) # type: ignore[arg-type,unused-ignore]
else:
llm.predict(**langchain_prompt_variables) # type: ignore
llm.predict(**langchain_prompt_variables) # type: ignore[arg-type,unused-ignore]
spans = in_memory_span_exporter.get_finished_spans()
spans_by_name = {span.name: span for span in spans}

Expand Down

0 comments on commit 3aa9ef6

Please sign in to comment.