Skip to content

Commit 83f02e3

Browse files
committed
Raise RuntimeError on attempting to iterate non streamable pipelines
1 parent bda2778 commit 83f02e3

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

pdal/libpdalpython.pyx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ cdef extern from "pdal/PointView.hpp" namespace "pdal":
8989
cdef extern from "pdal/PipelineManager.hpp" namespace "pdal":
9090
cdef cppclass PipelineManager:
9191
const PointViewSet& views() const
92+
bool pipelineStreamable() const
9293

9394

9495
cdef extern from "pdal/PipelineExecutor.hpp" namespace "pdal":
@@ -207,6 +208,9 @@ cdef class Pipeline(PipelineResultsMixin):
207208
self._get_json(), chunk_size, prefetch
208209
)
209210
self._configure_executor(executor)
211+
if not executor.getManagerConst().pipelineStreamable():
212+
raise RuntimeError("Pipeline is not streamable")
213+
210214
it = PipelineIterator()
211215
it.set_executor(executor)
212216
return it

test/test_pipeline.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,12 @@ def test_meshio(self, filename):
408408

409409

410410
class TestPipelineIterator:
411+
@pytest.mark.parametrize("filename", ["sort.json", "sort.py"])
412+
def test_non_streamable(self, filename):
413+
r = get_pipeline(filename)
414+
with pytest.raises(RuntimeError) as info:
415+
r.iterator()
416+
assert str(info.value) == "Pipeline is not streamable"
411417

412418
@pytest.mark.parametrize("filename", ["range.json", "range.py"])
413419
def test_array(self, filename):

0 commit comments

Comments
 (0)