Repost the question here: > hi team, how can I...
# questions
n
Repost the question here:
hi team, how can I pass a Null parameter to runtime params? when I do `kedro run --params key1:None" it get's interpreted as a string
@Miguel Angel Ortiz Marin
So there are two choices in mind: 1. Use the —config option so you can define that in YAML. 2. Use a resolver to do that conversion I find it weird to supply a null value in CLI as an argument. I am less sure if the 2. Option work, maybe there are better ways
As i understand the library you used has a default value, is that align with what you want? Otherwise there is a simple solution, which you use runtime_params resolver, where the default will be None. And you only pass in value if you want it to be something else.
r
Another work-around can be to have a delimiter like ('#') if passed treat it like None 🙂
Thank you @Ankita Katiyar for the suggestion below. @Miguel Angel Ortiz Marin you can make use of custom_resolvers as a work-around. settings.py
Copy code
def my_resolver(key):
    if key == 'None':
        return None

CONFIG_LOADER_ARGS = {
      "base_env": "base",
      "default_run_env": "local",
      "custom_resolvers": {
             "my_resolver": lambda key: my_resolver(key),
      }       }
}
and parameters.yml
Copy code
my_param: ${my_resolver:${runtime_params:key}}
this 1