Skip to content

Commit

Permalink
Fix taxi-runner.py cluster example (#2557)
Browse files Browse the repository at this point in the history
* Added regression test
* Fix modin package installation

Signed-off-by: Anatoly Myachev <anatoly.myachev@intel.com>
  • Loading branch information
anmyachev authored Dec 18, 2020
1 parent 9d9dc29 commit 6f5cdc6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
2 changes: 2 additions & 0 deletions modin/experimental/cloud/rayscale.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ def _conda_requirements(self):
reqs.append(self._get_modin_version())

reqs.extend(self.add_conda_packages)
else:
reqs.append(self._get_modin_version())

# this is needed, for example, for dependencies that
# looks like: "scikit-learn>=0.23"
Expand Down
25 changes: 19 additions & 6 deletions modin/experimental/cloud/test/test_cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,23 +107,36 @@ def test_create_or_update_cluster(make_ray_cluster, make_create_or_update_cluste
r"""conda create --clone base --name modin --yes
conda activate modin
conda install --yes {{CONDA_PACKAGES}}
pip install modin "ray==0.8.7" cloudpickle
"""
],
)
def test_update_conda_requirements(setup_commands_source, make_ray_cluster):
@pytest.mark.parametrize(
"user_packages",
[
["scikit-learn>=0.23", "modin==0.8.0"],
None,
],
)
def test_update_conda_requirements(
make_ray_cluster,
setup_commands_source,
user_packages,
):
fake_version = namedtuple("FakeVersion", "major minor micro")(7, 12, 45)
with mock.patch("sys.version_info", fake_version):
setup_commands_result = make_ray_cluster(
["scikit-learn>=0.23", "modin==0.8.0"]
user_packages
)._update_conda_requirements(setup_commands_source)

assert f"python>={fake_version.major}.{fake_version.minor}" in setup_commands_result
assert (
f"python<={fake_version.major}.{fake_version.minor}.{fake_version.micro}"
in setup_commands_result
)
assert "scikit-learn>=0.23" in setup_commands_result
assert "modin==0.8.0" in setup_commands_result
assert "{{CONDA_PACKAGES}}" not in setup_commands_result

if user_packages:
for package in user_packages:
assert package in setup_commands_result
else:
assert "modin=" in setup_commands_result

0 comments on commit 6f5cdc6

Please sign in to comment.