Hi all! :slightly_smiling_face: When I define a mo...
# questions
j
Hi all! 🙂 When I define a modular pipeline, I get:
Copy code
AttributeError: 'dict' object has no attribute 'startswith'
Apparently, the error goes back to one of this:
Copy code
\kedro\pipeline\modular_pipeline.py:218 in pipeline    

\kedro\pipeline\modular_pipeline.py:148 in _get_param_names_mapping                                                                         

\kedro\pipeline\modular_pipeline.py:113 in _normalize_param_name
Any help is really appreciated!
d
can you show your definition?
j
Sure!
Copy code
def standard_pipeline(dict_name, config_dict):
    save_results = config_dict.get("save_results")

    return modular_pipeline(
        pipe= aux(),
        inputs={"df": 'raw'},
        parameters={"params:params_dict": ArawToBclean_dicts[dict_name].get("params_dict")},
        outputs={
            "clean": 'clean'
            if save_results
            else "memory_" + config_dict["clean"],
        },
        namespace=dict_name,
    )
    )
d
and
modular_pipeline()
is that a method you’ve defined yourself?
j
I have imported it as:
Copy code
from kedro.pipeline.modular_pipeline import pipeline as modular_pipeline
d
gotcha
does
aux()
work on its own?
j
Yes! It just creates a pipeline:
Copy code
def create_pipeline(**kwargs) -> Pipeline:
    return Pipeline(
        [
            node(
                func=clean_df,
                inputs={
                    "df":"raw",
                    "params_dict":"params:params_dict"},
                outputs=["clean"],
                name="CleanFile",
            )
        ]
    )
d
Okay so from this perspective everything looks sensible
the next question is what is in each of the dictionaries you are dynamically retrieving back? all this is doing is a string is correctly prefixed, so somewhere in your modular pipeline construction a dictionary is being passed
if you’re in an IDE you could put a breakpoint where the
startswith
is failing and inspect what is actually in
name
j
Hi! Thank you so much for your help
I have found the error
params_dict was not defined as a parameter... thank for your advice!
💯 2