Skip to content
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

Allow for specifying extra node dependencies #3988

Open
lvijnck opened this issue Jul 4, 2024 · 2 comments
Open

Allow for specifying extra node dependencies #3988

lvijnck opened this issue Jul 4, 2024 · 2 comments
Labels
Issue: Feature Request New feature or improvement to existing feature

Comments

@lvijnck
Copy link
Contributor

lvijnck commented Jul 4, 2024

Description

I've always felt like Kedro misses the ability to specify additional dependencies among nodes, which are not dataset related.

Context

For instance, consider the problem of filling a knowledge graph though Kedro. Obviously, there's two main nodes:

  1. Write nodes
  2. Write edges

However, the edges cannot be written before the nodes were pushed. There is hence no "dataset" dependency between the nodes, but rather an execution dependency.

Possible Implementation

Adding this to Kedro would involve 1) addition to the node system and 2) and update to the topological execution mechanism. With respect to the nodes, dependencies could be specified as follows:

def create_pipeline(**kwargs) -> Pipeline:
    """Create embeddings pipeline."""
    return pipeline(
        [
            node(
                func=write_nodes,
                inputs=[
                    "int.nodes"
                ],
                outputs="prm.nodes",
                name="write_nodes",
            ),
            node(
                func=write_edges,
                inputs=[
                    "int.edges"
                ],
                outputs="prm.edges",
                name="write_edges",
                dependencies=["write_nodes"]
            )
       ]
  )

Possible Alternatives

The current work-around is to add "artificial" dataset dependencies among the nodes. This has the drawback that the function signatures of those nodes are polluted.

@lvijnck lvijnck added the Issue: Feature Request New feature or improvement to existing feature label Jul 4, 2024
@datajoely
Copy link
Contributor

Hey @lvijnck good to see you pop up here 👀 congrats on the new role!

The current way to do this is to pass a dummy dataset between the nodes to coerce the DAG into the right shape.

There are some open proposals on a more explicit mechanism of defining the DAG order. #1156 , I'm 99% @noklam has a concrete design somewhere, but I can't find it

@datajoely
Copy link
Contributor

This was the issue (now discussion) I was looking for, @lvijnck if you have any further thoughts please add them there as it really helps prioritise things

#3758

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Feature Request New feature or improvement to existing feature
Projects
None yet
Development

No branches or pull requests

2 participants