Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

map node inspection #264

Open
CJ-Wright opened this issue Jul 29, 2019 · 3 comments
Open

map node inspection #264

CJ-Wright opened this issue Jul 29, 2019 · 3 comments

Comments

@CJ-Wright
Copy link
Member

It might be nice to have warnings/errors raised when the function signature inside map et.al. does not match the number of incoming nodes. This won't work in all cases, since a function could take in args and kwargs and there is nothing to inspect from that, but it might work in some interesting cases.

The main benefit is that one could know before running any data into the pipeline if it was going to work. Since we know exactly how much data is going to be used in the function call we can know if it matches up and will work.

This might help with one of the main issues with streamz, writing pipelines can be more difficult than writing a naked script/notebook.

@martindurant
Copy link
Member

I would instead suggest being very conservative, and allowing some sort of verify_inputs=False optional arg.

Might also be nice to be able to run a pipeline in "dummy" mode, where the sinks are not actually executed, we just check that data gets there, and reset() is called on any aggregation node when done.

@CJ-Wright
Copy link
Member Author

I guess we'd need to implement a reset system first 😄. One could also consider this existing as a utility, which builds the graph of the pipeline and then check the inputs for each of the nodes.

A utility function (or context manager?) for the "dummy" mode might also work. Pass in a node, it builds the graph based off that node, builds a copy of the graph with various things (eg sinks) turned off and returns the node in the new graph. This way it won't impact your existing graph.

@martindurant
Copy link
Member

All of those sound like good ideas!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants