Hello Team! Is there a way to use a conditional st...
# questions
r
Hello Team! Is there a way to use a conditional statement to run
pipeline_1
if condition A is True, and
pipeline_2
if condition B is True?
h
hey @Robert Kwiatkowski could you share more details about what you're trying to achieve? for example, what kind of condition are you working with, and where does it come from?
r
@Huong Nguyen So I have a pipeline divided into two sections: 1. One preparing data
pipeline_0
which prepares data and checks the size of a sample. 2. An train&inference part where a. if a sample is bigger than a given threshold I want to use a
pipeline_1a
which trains a ML model b. if the sample size is smaller than a threshold I want to use rule-based, statistical method defined in
pipeline_1b
.
h
hey @Robert Kwiatkowski this is quite tricky, let me check with the team and will get back to you as soon as I can
👍 1
hey @Robert Kwiatkowski After exploring a few options, the short answer is that Kedro doesn’t directly support dynamic pipelines because it operates on a static graph. However, there is an ongoing discussion on this topic, with some workaround suggestions emerging from the community: 1️⃣ The key approach is to resolve any conditional logic in Python before constructing the Kedro pipeline, keeping the pipeline itself static. You can find more details on this in the discussion here: 🔗 GitHub Discussion #4495 2️⃣ Another potential solution is outlined here Hope this helps you customise a solution on your side! Let us know how it goes and if there’s anything else we can assist with. 😊
r
Thanks, I'll explore these options.
np 1