Skip to content
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

Update TemplatedConfigLoader with runtime params #2640

Closed
merelcht opened this issue Jun 5, 2023 · 6 comments
Closed

Update TemplatedConfigLoader with runtime params #2640

merelcht opened this issue Jun 5, 2023 · 6 comments

Comments

@merelcht
Copy link
Member

merelcht commented Jun 5, 2023

Description

Update TemplatedConfigLoader to fix runtime parameters not being passed properly. This can be done in the same way as it's done in OmegaConfigLoader

# settings.py
class MyTemplatedConfigLoader(TemplatedConfigLoader):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        if self.runtime_params:
            self._config_mapping.update(self.runtime_params)

CONFIG_LOADER_CLASS = MyTemplatedConfigLoader # TemplatedConfigLoader
# Keyword arguments to pass to the `CONFIG_LOADER_CLASS` constructor.
CONFIG_LOADER_ARGS = {
    "globals_pattern": "*globals.yml",
}

With recent changes we already started merging runtime_params in ConfigLoader. This question comes out quite often when people try to migrate from 0.17.x -> 0.18.x, maybe we should just fix it in 0.18.x.

https://www.linen.dev/s/kedro/t/12115548/hi-i-m-trying-to-migrate-from-kedro-0-17-to-kedro-0-18-and-h#5d1d302d-198f-4d13-839d-cdf7bc7892e8

@merelcht merelcht changed the title Consider update TemplateConfigLoader with runtime params Update TemplateConfigLoader with runtime params Jun 5, 2023
@merelcht merelcht changed the title Update TemplateConfigLoader with runtime params Update TemplatedConfigLoader with runtime params Jul 6, 2023
@astrojuanlu
Copy link
Member

Ahead of the removal of TemplatedConfigLoader, do we still want to do this?

@merelcht
Copy link
Member Author

My suggestion would be to leave this, more incentive for people to use the OmegaConfigLoader 😄

@astrojuanlu
Copy link
Member

I agree. Closing!

@astrojuanlu astrojuanlu closed this as not planned Won't fix, can't repro, duplicate, stale Aug 31, 2023
@datajoely
Copy link
Contributor

Can we now that globals is in that we're at feature parity now? Obv jinja isn't happening but we have pretty much everything now right?

@merelcht
Copy link
Member Author

Yes! You can see here that pretty much all features that were in TemplatedConfigLoader are in some way supported in OmegaConfigLoader: https://docs.kedro.org/en/stable/configuration/config_loader_migration.html

@datajoely
Copy link
Contributor

Amazing work everyone - feels like a very long journey getting here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

3 participants