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

Add --conf-source option to kedro ipython #2920

Closed
ankatiyar opened this issue Aug 11, 2023 · 4 comments · Fixed by #3199
Closed

Add --conf-source option to kedro ipython #2920

ankatiyar opened this issue Aug 11, 2023 · 4 comments · Fixed by #3199
Labels
Issue: Feature Request New feature or improvement to existing feature

Comments

@ankatiyar
Copy link
Contributor

ankatiyar commented Aug 11, 2023

Description

Right now we can pass env and params as options with kedro ipython / %reload_kedro. Add --conf-source option as well.

Context

User question from slack :

Speaking of kedro ipython :
Is there a way to specify /override the conf_source ? 🙂

My problem comes from the fact that we have a single pipeline / repo for all our clients.
To better enforce “tenant isolation”
I have organized conf and data as follow:
conf
└── client_A
├── base
└── local
└── client_B
├── base
└── local
data
├── client_A
│ └── 01_raw
│ └── 02_intermediate
│ └── ...
└── client_B
│ └── 01_raw
│ └── 02_intermediate
│ └── ...conf
I did so because I liked the idea of not being able to run the pipeline without being explicit about which client it should be done for…
(the structure above makes it so that kedro run without --conf-source will raise an error)
Another reason I did so (if I recall correctly) was to avoid having “duplicate keys” conflicts in the different yaml files across clients…

Possible Implementation

Changes to be made in kedro/ipython/__init__.py
PR for when --conf-source was added to kedro run - #2117

@ankatiyar ankatiyar added the Issue: Feature Request New feature or improvement to existing feature label Aug 11, 2023
@astrojuanlu
Copy link
Member

xref https://linen-slack.kedro.org/t/13906421/hi-again-speaking-of-kedro-ipython-is-there-a-way-to-specify#4b179fdf-0b5c-48cb-b287-6a53ed5b3bbb

@ankatiyar ankatiyar changed the title Add --conf_source option to kedro ipython Add --conf-source option to kedro ipython Oct 12, 2023
@laizaparizotto
Copy link
Contributor

Hi @ankatiyar, I would need some help to tackle this issue.

I read the PR #2117, but I am unsure how this should be implemented for ipython.

Is it that it should be first added as an @argument("--conf-source", type=str, default=None, help=CONF_SOURCE_HELP) here?

Then in function def reload_kedro add conf-source: str = None as an input

extra_params: dict[str, Any] = None,

And should be used as an input to load kedroSession

session = KedroSession.create(
        metadata.package_name, project_path, env=env, extra_params=extra_params, conf-source=conf-source
    ) 

session = KedroSession.create(

Please let me know what your ideas are.. 💡

@ankatiyar
Copy link
Contributor Author

@laizaparizotto I think what you've suggested looks about right, might be some more things are required. I haven't looked into the implementation myself but I can and in the meantime, if you can try this out too and open a PR(or a draft PR), we could collaborate on the implementation.

@laizaparizotto
Copy link
Contributor

Sure, @ankatiyar.

I will make the changes and open a PR soon. Thank you for the help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Feature Request New feature or improvement to existing feature
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants