Skip to content

Commit

Permalink
Ignore warning about an existing dask client, as we are explicitly co…
Browse files Browse the repository at this point in the history
…nstructing/passing in that client
  • Loading branch information
dagardner-nv committed Jan 12, 2024
1 parent 0913d14 commit 07ea3fd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion morpheus/utils/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import os
import threading
import typing
import warnings
from enum import Enum

import fsspec
Expand Down Expand Up @@ -131,7 +132,13 @@ def get_dask_client(self):
dask.config.set({"distributed.client.heartbeat": self._dask_heartbeat_interval})

if (self._merlin_distributed is None):
self._merlin_distributed = Distributed(client=dask.distributed.Client(self.get_dask_cluster()))
with warnings.catch_warnings():
# Merlin.Distributed will warn if a client already exists, the client in question is the one created
# and are explicitly passing to it in the constructor.
warnings.filterwarnings("ignore",
message="Existing Dask-client object detected in the current context.*",
category=UserWarning)
self._merlin_distributed = Distributed(client=dask.distributed.Client(self.get_dask_cluster()))

return self._merlin_distributed

Expand Down

0 comments on commit 07ea3fd

Please sign in to comment.