Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix taxi-runner.py cluster example #2557

Merged
merged 2 commits into from
Dec 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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