Alternative to D5613, this demonstrates a map method for unpacking dynamic outputs in the DSL.
- I opted away from map since I wasn't sure how to capture the return values and chaining given that a user could be trying to thread output nodes for different solid invocations. The end result is that the API feels more restrictive and you can't really make composites that have dynamic outputs as seen in . This may be a nice thing for our starting position.
- even though we mark the solid decorator as signature changing - it still sees the yield keyword, knows its a generator, and yells at you: Generator 'generator' has no 'forEach' member
can we add some magic to help with the lint warnings?
The error is Generator 'generator' has no 'map' member so the __iter__ approach had the upside of not triggering this.
The only thing I could find that works is the pylint setting generated-members=map, but this appears to globally ignore any no-member error that is about a member prefixed with map
edit: for clarification
x = 3 x.mapz() # no error x.map() # no error x.map_the_stuff() # no error x.mauhhhh # error x.mapuhhhh # no error x.pam_map() # error x.paz() # error
What if we added a map method to InvokedSolidOutputHandle that raises a NotImplementedError?
pylint sees that the function has yield in it so infers the return type to be Generator, which does not have map. Adding map to InvokedSolidOutputHandle does not remove the error.
I will spend some more time poking at pylint settings to see if i can find anything else
Having a hard time understanding what this is doing... This replaces the body of every solid with a call to unknown? Does this mean that we don't get any linting inside of a solid body?
this goal is to override the *inference* engines understanding of whats happening in the solid body, so it lo longer uses that information to for example give errors about using the output of invoking a solid due to its inference about its return type. I don't believe this blanks out all linting, just the inference result, by means of this decorator @astroid.inference_tip