long tracebacks

Open
#157 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
20/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
python

Research direction

Start by reviewing the Stream usage shown in the issue and the proposed to_graph() and run(graph, input) entry points. The issue does not identify files, tests, an existing execution path, or acceptance criteria, so the desired traceback behavior and definition of done need to be established first.

Written by the indexing model from the issue text.

Description

I'm wondering if we can avoid long tracebacks:

In [1]: from streamz import Stream

In [2]: s = Stream()

In [3]: snext = s
   ...: for i in range(10):                                                                     
   ...:     snext = snext.map(lambda x : x)
   ...:     

In [4]: def foo(x):
   ...:     raise ValueError("Foo")                                                                               
   ...: 

In [5]: snext.sink(foo)
Out[5]: <sink: foo>

In [6]: s.emit(1)
.... Long error message
<ipython-input-4-9636b5287c3d> in foo(x)
      1 def foo(x):
----> 2     raise ValueError("Foo")

ValueError: Foo

A way around this could be that the stream returns a graph which is executed one by one by an external function, like:

graph = s.to_graph()
run(graph, input)

where the run function would walk through each node in the graph in a top-down fashion and resolve the results.

Any other thoughts? Just an idea I figured I'd document somewhere. thanks!

Dominant language
Python
Stars
1.3k
Forks
149
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from python-streamz/streamz

All issues in python-streamz/streamz

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.