Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(nodes): improve types in graph.py
Methods `get_node` and `complete` were typed as returning a dynamically created unions `InvocationsUnion` and `InvocationOutputsUnion`, respectively. Static type analysers cannot work with dynamic objects, so these methods end up as effectively un-annotated, returning `Unknown`. They now return `BaseInvocation` and `BaseInvocationOutput`, respectively, which are the superclasses of all members of each union. This gives us the best type annotation that is possible. Note: the return types of these methods are never introspected, so it doesn't really matter what they are at runtime.
- Loading branch information