Skip to content

Commit c3482ee

Browse files
Raise helpful error when using the wrong plugin base classes (#8893)
1 parent 390e9a4 commit c3482ee

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

distributed/client.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5101,6 +5101,14 @@ def _register_plugin(
51015101
):
51025102
if isinstance(plugin, type):
51035103
raise TypeError("Please provide an instance of a plugin, not a type.")
5104+
if any(
5105+
"dask.distributed.diagnostics.plugin" in str(c)
5106+
for c in plugin.__class__.__bases__
5107+
):
5108+
raise TypeError(
5109+
"Importing plugin base classes from `dask.distributed.diagnostics.plugin` is not supported. "
5110+
"Please import directly from `distributed.diagnostics.plugin` instead."
5111+
)
51045112
raise TypeError(
51055113
"Registering duck-typed plugins is not allowed. Please inherit from "
51065114
"NannyPlugin, WorkerPlugin, or SchedulerPlugin to create a plugin."

0 commit comments

Comments
 (0)