Skip to content

Commit bea152d

Browse files
authored
Merge pull request #638 from Bodo-inc/sahil/fix-view-bug-and-passthrough-flags
Pass through `kwargs` in `Client.broadcast_view()`
2 parents 17762ae + d48db49 commit bea152d

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

ipyparallel/client/client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2085,6 +2085,7 @@ def broadcast_view(self, targets='all', is_coalescing=False, **kwargs):
20852085
client=self,
20862086
socket=self._broadcast_stream,
20872087
targets=targets,
2088+
**kwargs,
20882089
)
20892090
bcast_view.is_coalescing = is_coalescing
20902091
return bcast_view

ipyparallel/client/view.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,8 @@ class DirectView(View):
400400
401401
"""
402402

403-
def __init__(self, client=None, socket=None, targets=None):
404-
super().__init__(client=client, socket=socket, targets=targets)
403+
def __init__(self, client=None, socket=None, targets=None, **flags):
404+
super().__init__(client=client, socket=socket, targets=targets, **flags)
405405

406406
@property
407407
def importer(self):

ipyparallel/tests/test_view.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -929,3 +929,14 @@ def func(x):
929929
res = view.apply_async(func, 5)
930930
assert res.get(timeout=10) == []
931931
view.use_pickle()
932+
933+
def test_block_kwarg(self):
934+
"""
935+
Tests that kwargs such as 'block' can be
936+
specified when creating a view, in this
937+
case a BroadcastView
938+
"""
939+
view = self.client.broadcast_view(block=True)
940+
assert view.block == True
941+
# Execute something as a sanity check
942+
view.execute("5", silent=False)

0 commit comments

Comments
 (0)