Skip to content
Closed
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
12 changes: 8 additions & 4 deletions distributed/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -3198,8 +3198,10 @@ def gpu_startup(worker):

def print(*args, **kwargs):
"""Dask print function
This prints both wherever this function is run, and also in the user's
client session

This is a wrapper around Python's built-in :external+python:py:func:`print` function
that prints both wherever this function is run, and also in the user's
client session.
"""
try:
worker = get_worker()
Expand All @@ -3217,8 +3219,10 @@ def print(*args, **kwargs):

def warn(*args, **kwargs):
"""Dask warn function
This raises a warning both wherever this function is run, and also
in the user's client session

This is a wrapper around Python's built-in :py:func:`warnings.warn` function
that emits a warning both wherever this function is run, and also
in the user's client session.
"""
try:
worker = get_worker()
Expand Down
4 changes: 4 additions & 0 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ The client connects to and submits computation to a Dask cluster (such as a :cla
get_task_stream
get_task_metadata
performance_report
print
warn


**Utilities**
Expand Down Expand Up @@ -188,6 +190,8 @@ Other
.. autoclass:: get_task_stream
.. autoclass:: get_task_metadata
.. autoclass:: performance_report
.. autofunction:: distributed.print
.. autofunction:: distributed.warn


Utilities
Expand Down