-
Notifications
You must be signed in to change notification settings - Fork 915
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
kedro marimo
+ better programmatic setup for non jupyter/ipython envs
#4440
Comments
I read the thread in marimo but I cannot signup/login to Discord so I can only comment here. The majority of the magic function is making sure the root path is set correctly. They are not too important in the context of using absolute path but as Python cares where do you actually execute the command from. The function itself is rather simple, it's mostly a syntax sugar to get started quickly but I suppose we should have some documentation on how to do this programmatically. As long as the session is created in the correct path, it should work. What exactly is failing from marimo? In any case I think it will be an easy fix. |
I read the thread in marimo but I cannot signup/login to Discord so I can only comment here. The majority of the magic function is making sure the root path is set correctly. They are not too important in the context of using absolute path but as Python cares where do you actually execute the command from. The function itself is rather simple, it's mostly a syntax sugar to get started quickly but I suppose we should have some documentation on how to do this programmatically. As long as the session is created in the correct path, it should work. The main way to run kedro programmatically is to create a Kedro Session, this is what the magic command do behind the scene. The link provided an example, and basically you need to provide the correct path to the bootstrap function and you should be good to go. |
Agree with @noklam that you should be able to create your The magic just makes it slightly more convenient.
This is much broader scoped, but IMO would be very valuable. I actually started looking into this last year, but it would be very helpful to try to figure out what we want to accomplish. In the past, we had Marimo is different (I Obviously needs some more thought, but I think the right way to think about this might actually be:
A @lucharo would also love to hear if this vision for a Disclaimer: This is very much stream-of-consciousness and based on what I remember of looking into doing this in the past; may edit later. |
Thanks a lot @lucharo for opening this issue! I want to log that ultimately this connected to Kedro's magic handling of relative paths in Your solution using |
We don't currently, though it's an interesting idea.
marimo does have an in-memory representation. There is no public API yet, but for the purposes of this integration we could experiment using internal APIs if needed
"marimo as an editor for pipelines" is an exciting vision indeed. @lucharo, curious if it resonates with you? |
Hi all, apologies for the delayed response. I am glad that opening this issue has sparked enthusiasm from both the Kedro and Marimo teams. I see this issue breaking down into 3 sub-issues/potential Kedro-Marimo crossovers, let me explain:
Kedro and Marimo are already similar enough for the symbiosis that @deepyaman suggests to happen, you both define DAGs and isolate nodes within functions. @deepyaman suggests turning kedro into marimo notebooks and I would like to suggest doing the opposite. Support kedro as an output format for marimo: Finally "marimo as an editor for pipelines" is indeed an exciting vision @akshayka, does it align with marimo's roadmap/mission? |
Description
I'm frustrated by Kedro's heavy reliance on IPython magics (%reload_kedro) for notebook setup. While this works for Jupyter, it creates barriers for:
kedro run
is often used for thoseI first encountered this issue when importing data from the catalog in a marimo notebook. If
kedro-project/
is the root of my project, my notebook sits inkedro-project/nbs/notebook.py
. I find that if I run the notebook fromkedro-project/
or fromkedro-project/nbs/
the behaviour isn't the same. I currently use this code to load the config:from
kedro-project/nbs
:-> ❌ fails as it thinks the filepath for
mytable
is relative to the current directory instead of the project's rootfrom
kedro-project
:-> ✅ works fine because we are in the project's root
my catalog looks something like:
Context
To use kedro in marimo notebooks more easily. It has been suggested to parametrise the catalog with a file path but I don't think that's a very nice solution and hopefully this can be implemented automatically without magic outside of jupyter/ipython.
Possible Implementation
I've dug around the
%reload_kedro
magic code and I think we could re use some of that, I haven't fully tested it but I think it should work e.g.:The point here is to make
_find_kedro_project
available in the public API and document this way of setting up a kedro session for non jupyter users.PS
catalog.load
but I thinkkedro
could benefit from a programmatic magic-free way of connecting to the project's config/catalogkedro marimo
command, I think it would be a nice merging of 2 worlds.The text was updated successfully, but these errors were encountered: