Skip to content

Commit 3aa9ef6

Browse files
authored
ci: ensure type ignores in langchain tests run across all versions of 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)).
1 parent 8306ff2 commit 3aa9ef6

File tree

1 file changed

+4
-4
lines changed
  • python/instrumentation/openinference-instrumentation-langchain/tests/openinference/instrumentation/langchain

1 file changed

+4
-4
lines changed

python/instrumentation/openinference-instrumentation-langchain/tests/openinference/instrumentation/langchain/test_instrumentor.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -533,9 +533,9 @@ def test_chain_metadata(
533533
# We will test that these variables do not overwrite the passed variables
534534
prompt_template_variables=prompt_template_variables,
535535
):
536-
llm.predict(**langchain_prompt_variables) # type: ignore
536+
llm.predict(**langchain_prompt_variables) # type: ignore[arg-type,unused-ignore]
537537
else:
538-
llm.predict(**langchain_prompt_variables) # type: ignore
538+
llm.predict(**langchain_prompt_variables) # type: ignore[arg-type,unused-ignore]
539539
spans = in_memory_span_exporter.get_finished_spans()
540540
spans_by_name = {span.name: span for span in spans}
541541

@@ -658,9 +658,9 @@ def test_read_session_from_metadata(
658658
# We will test that these variables do not overwrite the passed variables
659659
prompt_template_variables=prompt_template_variables,
660660
):
661-
llm.predict(**langchain_prompt_variables) # type: ignore
661+
llm.predict(**langchain_prompt_variables) # type: ignore[arg-type,unused-ignore]
662662
else:
663-
llm.predict(**langchain_prompt_variables) # type: ignore
663+
llm.predict(**langchain_prompt_variables) # type: ignore[arg-type,unused-ignore]
664664
spans = in_memory_span_exporter.get_finished_spans()
665665
spans_by_name = {span.name: span for span in spans}
666666

0 commit comments

Comments
 (0)