-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add CodeNode #992
base: main
Are you sure you want to change the base?
Add CodeNode #992
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great.
In terms of an editor I've been wanting to get going with https://codemirror.net/
5985c7c
to
914e864
Compare
Screencast.from.2024-12-13.22-42-34.mp4 |
Currently the python is extremely restricted. As we overwrite There are other potentially safe functions that we could add, e.g: This can happen in a followup, I think the basic functionality is enough to get going with. |
("return f'Hello, {input}!'", "World", "Hello, World!"), | ||
("", "foo", "foo"), # No code just returns the input | ||
(EXTRA_FUNCTION, "blah", "other blah"), # Calling a separate function is possible | ||
("'foo'", "", "None"), # No return value will return "None" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if we should instead raise an exception in this case, as it was probably not intentional to not return a string.
Made a few updates after @bderenzi gave some feedback on slack. Now the Screencast.from.2024-12-14.21-26-28.mp4 |
45f1ca2
to
363d564
Compare
Description
Runs arbitrary python within the pipeline.
It essentially is running a function:
The return value of the function is used as the output.
The main reason I encapsulated it inside of a separate function is that you can then:
return
statementI still need to add: a code widget (is there a preference? I was thinking of using
ace
as I think that is what is used in HQ)For now, this doesn't access "shared state" that we had also spoken about, but I wanted to get this out there for discussion first.
User Impact
Demo
Screencast.from.2024-12-13.15-03-02.mp4
Docs