alteryx / alteryx/evalml

DaskEngine: Repeated Use with Context Manager

Aperta
#2,726 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
enhancement
Lingua principale
Python
Stelle
850
Fork
96
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Per #2667 , it was noted that a DaskEngine can't be used in a context manager as the manager will shutdown the associated cluster. We should probably modify the `__enter__()` function to restart the cluster if it's shutdown.

```
def test_automl_dask_called_twice(
X_y_binary_cls,
):
"""Making sure that the max_iterations parameter limits the number of pipelines run."""

X, y = X_y_binary_cls
max_iterations = 4
engine = DaskEngine()
with engine:
par_automl = AutoMLSearch(
X_train=X,
y_train=y,
problem_type="binary",
engine=engine,
max_iterations=max_iterations,
)
par_automl.search()

with engine:
par_automl = AutoMLSearch(
X_train=X,
y_train=y,
problem_type="binary",
engine=engine,
max_iterations=max_iterations,
)
par_automl.search()
```

The above code snippet should be modified into a test that passes.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.