-
Notifications
You must be signed in to change notification settings - Fork 905
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
Override new pipeline template #2543
Comments
https://docs.kedro.org/en/stable/kedro_project_setup/starters.html#how-to-create-a-kedro-starter You can create your own starter. |
Sorry, I just read that again and you actually want to override the pipeline template. This is currently not possible, as it follows the modular pipeline structure. How do you want to change it? It would be great if you share some example and reason why you want to change it that way. |
It's a pretty simple change, we prefer to put the node and pipeline definitions in a single file (at least by default). Optionally, the file would be called I also wrote a decorator to build nodes at declaration time, and it'd be nice if I could have the generated pipeline source automatically import that decorator. Pretty sure I know how to do this in the cookiecutter template Kedro uses internally, but it sounds like there isn't currently a way to override that at the project level. |
That's a fair point about the filename. Could you give some code example what you mean by build node at declaration tim and how that plays with the pipeline definition? Do you mean you simply write function and use decorator to build this as a node? Possibly relate to #2471? The current auto pipeline discovery relies on the modular pipeline structure. In the meantime you can always extend or override the CLI by importing the KedroCLI class. |
As I understand it, the auto discovery is just looking for a https://gist.github.com/jasonmhite/59870a929fac44a925bd5608d6adb465 -- note: imagine the - in the filenames were / instead, github won't let me simulate folders. And indeed, the decorator I made seems similar to #2471 though I hadn't seen that. I find that syntax to be very ergonomic and the implementation is pretty trivial, it'd be a nice feature in its own right. I'll comment there. |
This makes a lot of sense I think. Agree about the problem with multiple This wouldn't be hard to achieve if we added a flag to the kedro/kedro/framework/cli/pipeline.py Line 193 in 2e70dec
This would then work much the same way as we allow different You could actually already achieve this by writing your own custom |
@antonymilne That's helpful, I'll look into seeing if I can make this change when I have a bit of time. |
@antonymilne I implemented this via a config option for I was able to make a starter that includes a pipeline template and preconfigured to use it, which is exactly what I wanted. https://code.ornl.gov/4uh/kedro-template |
I'd like to override the code that is generated by
kedro pipeline create
to better suit some conventions we have developed on my team. Specifically, I'm trying to build a new Kedro starter that implements some of our conventions, and ideally I'd like to have a starter that also includes a template to generate new modular pipeline boilerplate in the format we have adopted automatically.It seems like the code generated is drawn from the cookiecutter template in
kedro/kedro/templates/pipeline
and I know how to modify that, however I can't seem to find a way to override/extend that template at the project level in the documentation. Could someone provide some guidance? Thanks in advance and apologies if the Issues are not the right place to ask.The text was updated successfully, but these errors were encountered: