You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to use external pip dependency mlflow, errors are thrown when code contains:
import mlflow
Is this a regression?
Not sure, I encountered this error while trying to migrate a repository from WORKSPACE rules_python to bzlmod with a test that uses mlflow. The test passes under WORKSPACE but fails under bzlmod. However, when I tried to recreate the issue in a minimal repro, the test fails under both WORKSPACE and bzlmod.
Description
When a py_test or py_binary contains:
import mlflow
the following error is thrown when running the code with bazel run or bazel test:
ImportError: cannot import name 'Resource' from 'mlflow.models.resources' (/private/var/tmp/_bazel_tkaplan/5b13b869a536c448538040ea91145cae/sandbox/darwin-sandbox/1/execroot/_main/bazel-out/darwin_arm64-fastbuild/bin/test.runfiles/rules_python++pip+pypi_312_mlflow_skinny/site-packages/mlflow/models/resources/__init__.py)
exec ${PAGER:-/usr/bin/less} "$0" || exit 1
Executing tests from //:test
-----------------------------------------------------------------------------
Traceback (most recent call last):
File "/private/var/tmp/_bazel_tkaplan/5b13b869a536c448538040ea91145cae/sandbox/darwin-sandbox/1/execroot/_main/bazel-out/darwin_arm64-fastbuild/bin/test.runfiles/_main/test.py", line 1, in
import mlflow
File "/private/var/tmp/_bazel_tkaplan/5b13b869a536c448538040ea91145cae/sandbox/darwin-sandbox/1/execroot/_main/bazel-out/darwin_arm64-fastbuild/bin/test.runfiles/rules_python++pip+pypi_312_mlflow_skinny/site-packages/mlflow/__init__.py", line 35, in
from mlflow import (
File "/private/var/tmp/_bazel_tkaplan/5b13b869a536c448538040ea91145cae/sandbox/darwin-sandbox/1/execroot/_main/bazel-out/darwin_arm64-fastbuild/bin/test.runfiles/rules_python++pip+pypi_312_mlflow_skinny/site-packages/mlflow/models/__init__.py", line 46, in
from mlflow.models.model import Model, get_model_info, set_model, update_model_requirements
File "/private/var/tmp/_bazel_tkaplan/5b13b869a536c448538040ea91145cae/sandbox/darwin-sandbox/1/execroot/_main/bazel-out/darwin_arm64-fastbuild/bin/test.runfiles/rules_python++pip+pypi_312_mlflow_skinny/site-packages/mlflow/models/model.py", line 20, in
from mlflow.models.resources import Resource, ResourceType, _ResourceBuilder
ImportError: cannot import name 'Resource' from 'mlflow.models.resources' (/private/var/tmp/_bazel_tkaplan/5b13b869a536c448538040ea91145cae/sandbox/darwin-sandbox/1/execroot/_main/bazel-out/darwin_arm64-fastbuild/bin/test.runfiles/rules_python++pip+pypi_312_mlflow_skinny/site-packages/mlflow/models/resources/__init__.py)
🐞 bug report
When trying to use external pip dependency
mlflow
, errors are thrown when code contains:Is this a regression?
Not sure, I encountered this error while trying to migrate a repository from WORKSPACE rules_python to bzlmod with a test that uses mlflow. The test passes under WORKSPACE but fails under bzlmod. However, when I tried to recreate the issue in a minimal repro, the test fails under both WORKSPACE and bzlmod.
Description
When a py_test or py_binary contains:
the following error is thrown when running the code with
bazel run
orbazel test
:🔬 Minimal Reproduction
https://github.com/thirtyseven/mlflow-repro
🔥 Exception or Error
🌍 Your Environment
Operating System:
Output of
bazel version
:Rules_python version:
Anything else relevant?
The text was updated successfully, but these errors were encountered: