[WIP] feat: build FunctionGraph from functions#1271
Conversation
|
Hey -- sorry, it's been a bit, will be looking over soon! |
| @@ -143,7 +143,7 @@ def update_dependencies( | |||
|
|
|||
|
|
|||
| def create_function_graph( | |||
There was a problem hiding this comment.
The type signature of this should be updated.
There was a problem hiding this comment.
also 🤦 (at myself I think) that the name of this function and what it returns - a dict, not a function graph...
|
Yeah so what's left? This ?
|
|
My expectation # module Z
# some funcs
# module 1
def func1( ...) -> ...:
...
# module 1, or perhaps another module 2
def func2(...)->...:
...
# driver code somewhere else or in one of the modules - importing things appropriately
funcs = [func1, func2]
driver.Builder().with_modules(module_z, *funcs)... # this should workit should also work with |
|
I saw the note in #1271:
FYI I attempted this with this branch, but it returns |
@leblancfg You're ahead of us! Will open a separate PR and share my marimo development pattern once this is merged. Feel free to discuss here #1274 |
|
OK, That said -- in order to have function overrides, we should probably want to combine |
Disagree. I think this will make things more confusing, as it will:
I think extending |
|
closing in favor of #1275 |
Changes
graph.create_function_graph()instead ofgraph.FunctionGraph.from_modules()needed to be updated.graph.create_function_graph()was modified, but it was never advertised as a public API. Further rewiring could provide full backwards compatibility (could do after validating the general solution)TODO
create_function_graph()for fully backwards-compatible APiHow I tested this
Notes
graph.create_function_graph()should really return aFunctionGraphinstead of adict