Skip to content

Add langchain-openai to extra-ml-requirements.txt#19363

Merged
harupy merged 2 commits intomasterfrom
copilot/add-langchain-openai-requirement
Dec 13, 2025
Merged

Add langchain-openai to extra-ml-requirements.txt#19363
harupy merged 2 commits intomasterfrom
copilot/add-langchain-openai-requirement

Conversation

Copy link
Contributor

Copilot AI commented Dec 13, 2025

Related Issues/PRs

Fixes import error from https://github.com/mlflow/dev/actions/runs/20167909408/job/57895769194#step:11:90

What changes are proposed in this pull request?

The test file tests/langchain/test_langchain_model_export.py imports ChatOpenAI from langchain_openai, which is a separate package from langchain. This causes tests/pyfunc/docker/test_docker_flavors.py to fail when importing fixtures from it:

# tests/pyfunc/docker/test_docker_flavors.py:34
from tests.langchain.test_langchain_model_export import fake_chat_model  # noqa: F401

# tests/langchain/test_langchain_model_export.py:38
from langchain_openai import ChatOpenAI  # ModuleNotFoundError

Added langchain-openai to requirements/extra-ml-requirements.txt alongside langchain.

How is this PR tested?

  • Existing unit/integration tests

Does this PR require documentation update?

  • No. You can skip the rest of this section.

Release Notes

Is this a user-facing change?

  • No. You can skip the rest of this section.

What component(s), interfaces, languages, and integrations does this PR affect?

Components

  • area/build: Build and test infrastructure for MLflow

How should the PR be classified in the release notes? Choose one:

  • rn/none - No description will be included. The PR will be mentioned only by the PR number in the "Small Bugfixes and Documentation Updates" section

Should this PR be included in the next patch release?

  • Yes (this PR will be cherry-picked and included in the next patch release)
Original prompt

Add langchain-openai in requirements/extra-ml-requirements.txt to fix the following error

_________ ERROR collecting tests/pyfunc/docker/test_docker_flavors.py __________
ImportError while importing test module '/home/runner/work/dev/dev/tests/pyfunc/docker/test_docker_flavors.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/opt/hostedtoolcache/Python/3.10.19/x64/lib/python3.10/importlib/init.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/pyfunc/docker/test_docker_flavors.py:34: in
from tests.langchain.test_langchain_model_export import fake_chat_model # noqa: F401
tests/langchain/test_langchain_model_export.py:38: in
from langchain_openai import ChatOpenAI
E ModuleNotFoundError: No module named 'langchain_openai'

https://github.com/mlflow/dev/actions/runs/20167909408/job/57895769194#step:11:90

Include this error and the job link in the PR description


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: harupy <17039389+harupy@users.noreply.github.com>
Copilot AI changed the title [WIP] Add langchain-openai to extra ML requirements Add langchain-openai to extra-ml-requirements.txt Dec 13, 2025
Copilot AI requested a review from harupy December 13, 2025 03:46
@harupy harupy marked this pull request as ready for review December 13, 2025 03:48
Copilot AI review requested due to automatic review settings December 13, 2025 03:48
@github-actions github-actions bot added area/build Build and test infrastructure for MLflow rn/none List under Small Changes in Changelogs. labels Dec 13, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a ModuleNotFoundError that occurs when running tests in tests/pyfunc/docker/test_docker_flavors.py by adding the missing langchain-openai dependency to the extra ML requirements file.

  • Added langchain-openai to requirements/extra-ml-requirements.txt alongside the existing langchain package

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@harupy harupy added this pull request to the merge queue Dec 13, 2025
Merged via the queue into master with commit 5e876eb Dec 13, 2025
87 of 111 checks passed
@harupy harupy deleted the copilot/add-langchain-openai-requirement branch December 13, 2025 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build Build and test infrastructure for MLflow rn/none List under Small Changes in Changelogs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants