Skip to content

Commit b169c78

Browse files
committed
FEAT-#1981: Warn when LocalCluster() receives ignored arguments
Signed-off-by: Vasilij Litvinov <vasilij.n.litvinov@intel.com>
1 parent 16d4f46 commit b169c78

File tree

1 file changed

+25
-6
lines changed

1 file changed

+25
-6
lines changed

modin/experimental/cloud/local_cluster.py

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
import subprocess
1515
import sys
16+
import warnings
1617

1718
from .base import ConnectionDetails
1819
from .cluster import BaseCluster
@@ -64,6 +65,9 @@ def _get_service():
6465
return LocalWrappingService
6566

6667

68+
_UNUSED = object()
69+
70+
6771
class LocalCluster(BaseCluster):
6872
target_engine = "Cloudpython"
6973
target_partition = "Pandas"
@@ -73,13 +77,28 @@ class LocalCluster(BaseCluster):
7377
def __init__(
7478
self,
7579
provider,
76-
project_name,
77-
cluster_name="modin-cluster",
78-
worker_count=4,
79-
head_node_type=None,
80-
worker_node_type=None,
80+
project_name=_UNUSED,
81+
cluster_name=_UNUSED,
82+
worker_count=_UNUSED,
83+
head_node_type=_UNUSED,
84+
worker_node_type=_UNUSED,
8185
):
82-
assert provider == "local"
86+
assert (
87+
provider == "local"
88+
), "Local cluster can only be spawned with 'local' provider"
89+
if any(
90+
arg is not _UNUSED
91+
for arg in (
92+
project_name,
93+
cluster_name,
94+
worker_count,
95+
head_node_type,
96+
worker_node_type,
97+
)
98+
):
99+
warnings.warn(
100+
"All parameters except 'provider' are ignored for LocalCluster, do not pass them"
101+
)
83102
super().__init__(provider, "test-project", "test-cluster", 1, "head", "worker")
84103

85104
def _spawn(self, wait=False):

0 commit comments

Comments
 (0)