Hi All, is there a way to create dependencies betw...
# hamilton-help
j
Hi All, is there a way to create dependencies between nodes when one of them returns None? For example, having a node creating a table in a db and then run another node after that. They way i thought was to return a boolean but wondering if there's another way recommended as I couldnt find anything in the docs. Thanks
e
So there’s no special case but
None
and
NoneType
should work
That said, there might be room for side-effects encoded in the library. Idea:
Copy code
h_types.SideEffect("Table_foo")
or something like that
👍 1
s
Copy code
def a(input: SomeType) -> None:
    # do stuff
    

def b(a: None, other_param: ...) -> some_other_type:
    return ...
@Joao Castro the above should work ^ ; i.e.
a
has None, and anything that depends on it just uses
None
as the type if you want it in the graph. Otherwise you could do a boolean, return metadata, etc. Up to you - that should still work.
👍 1
@Joao Castro if that gets ugly, we could also consider a decorator that declares this, but I like the explicitness here.
👍 1
j
Thanks guys!