Marshall Krassenstein
08/16/2024, 4:34 PMnamespace argument. https://docs.kedro.org/en/stable/nodes_and_pipelines/namespaces.html#what-is-a-namespace
Is there a way to access the namespace attribute once you define the pipeline?Laura Couto
08/18/2024, 5:50 PMMarshall Krassenstein
08/18/2024, 8:47 PMPipeline(pipe, inputs, outputs, *parameters*)?Laura Couto
08/18/2024, 9:45 PMNok Lam Chan
08/19/2024, 10:13 AMMarshall Krassenstein
08/19/2024, 12:04 PMpipeline_registry.py at runtime with the intention of modifying them based on the user tag argument
The goal is to let the user choose between running two pipelines with mostly identical steps (the circle in the middle is an "XOR" block). The tricky part is the parameters files. DataPrep A has a parameters.yml file with the namespace data_prep_a. DataPrep B has a parameters.yml file with the namespace data_prep_b. Downstream, I have the Model subpipeline reference parameters via params:data_prep.parameter_here. Ideally at runtime, the parameters referenced by model would be modified based on the tag argument.
So if I run kedro run -t A, the parameters of each node in the model pipeline should be intercepted and everywhere params:data_prep.some_parameter_here is referenced should be replaced by params:data_prep_a.some_parameter_here . Since parameters can be defined in pipelines in addition to nodes, these parameters also need to be intercepted at the subpipeline level.
Does that make sense? I realize I would be modifying attributes that aren't supposed to be modified at runtime.Nok Lam Chan
08/19/2024, 12:13 PMtag is supposed to do (filtering instead of updating)Nok Lam Chan
08/19/2024, 12:14 PMMarshall Krassenstein
08/19/2024, 12:18 PMdata_prep.
Fully acknowledge that I am not using tag in the way it is designed to be used 😅Marshall Krassenstein
08/19/2024, 12:43 PMMarshall Krassenstein
08/19/2024, 12:51 PMcatalog / parameters file from consideration at runtime, I think that would also workNok Lam Chan
08/19/2024, 1:00 PMNok Lam Chan
08/19/2024, 1:01 PMmy_pipeline = pipeline( some_node, inputs = f"{tag}.some_params_group", ...)
You don't really need to update the pipeline object, but rather getting the right namespace before you create the pipeline.Marshall Krassenstein
08/19/2024, 1:42 PMpipeline.py file instead of pipeline_registry.py?Marshall Krassenstein
08/19/2024, 1:48 PMkedro run -t from_file, the namespace, deploy_application should change to deploy_application_from_file and the parameters referencing params:deploy_forecast should change to params:deploy_forecast_from_fileMarshall Krassenstein
08/19/2024, 2:49 PMmodel that has two possible parameters files model_a.yml and model_b.yml , both of which have the namespace model
If I run kedro run -t A , I would like the namespace of model_b.yml to change to something unused, such as *x_*model_*x*Nok Lam Chan
08/19/2024, 2:54 PMSo lets say I have a pipelinethat has two possible parameters filesmodelandmodel_a.yml, both of which have the namespacemodel_b.ymlmodel
If I runThis sounds a bit strange, why would you change the namespace of a file instead of having a different namespace and select the correct namespace instead?, I would like the namespace ofkedro run -t Ato change to something unused, such asmodel_b.yml*x_*model_*x*
Marshall Krassenstein
08/19/2024, 3:12 PMpipeline file to the correct namespace as well as all of the pipeline parameters whereas changing only the namespace within a parameters file requires no changes to any of the pipelinesMarshall Krassenstein
08/19/2024, 7:04 PMmodel_a.yml and other a related parameters files get put in a folder model_a . 
• model_b.yml and other b related parameters files get put in a folder model_b . 
• In globals.yml or similar, specify which path between A or B to use. (parameters_source)
• In pipeline_registry.py filter pipelines based on this file
• In settings.py change the config patterns based on this file e.g. 
CONFIG_LOADER_ARGS = {
    "base_env": "base",
    "default_run_env": "local",
    "config_patterns": {
        "parameters": [
            "parameters*",
            "parameters*/**",
            f"{parameters_source}/parameters*",
        ],
    },
}