-
Notifications
You must be signed in to change notification settings - Fork 906
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
Check whether DataCatalog
changes are reflected in the session
#2728
Comments
I've been trying to achieve this aswell. It would be a great feature to add. |
@gitgud5000 Can you detail a bit more what are you trying to achieve and why? We are trying to come up with use cases for this change. |
@astrojuanlu I'm trying to pass additional save_args based on the output of the node that creates a My plan was to modify the catalog in a |
What I ended up doing was implementing a subclass of |
I don't think mutating DataCatalog is a good thing to do. I believe the hook system was designed in a way to avoid this exactly (correct me if I am wrong). I am unsure if this example correct though because There are however use cases that is very useful. |
That's fair enough, but not the impression that I got when I saw a |
I think we need to clarify what's not working here. I think there are two conflicting features here and we need to think of it carefully.
In any case, we should list out why we want to make this a singleton. I don't have the full context why it was designed that way, may be good to dig out the old issues and PR, but I don't have it now. |
Another user was confused by this but found a workaround that worked for their use case: using |
DataCatalog
a context-wide singleton?DataCatalog
can be mutated but changes are not reflected in the session
Maybe the action item for this ticket is:
Is there a good reason Kedro should start supporting this? |
DataCatalog
can be mutated but changes are not reflected in the sessionDataCatalog
changes are reflected in the session
@ElenaKhaustova to check again if this happens with |
I double-checked that this behaviour is only relevant for This change is explained by the removing
Note: For kedro/kedro/io/kedro_data_catalog.py Line 577 in a1fae50
@astrojuanlu, @merelcht, @ankatiyar, @noklam, @lrcouto, @DimedS, based on the above, I suggest closing the ticket. It works as expected for the new catalog, which will soon replace the old one. |
Thanks @ElenaKhaustova ! Closing |
Today I wanted to apply an "advanced" hook use case: storing the catalog and then injecting datasets on the fly. However, it doesn't work:
the
self._catalog
that gets saved receives the.add(..., replace=True)
correctly, but thecatalog.load
that comes immediately after thebefore_dataset_loaded
hook still has the old dataset:kedro/kedro/runner/runner.py
Lines 403 to 404 in fd8162d
Using
after_context_created
gets the same result.Context: I was trying to give a workaround for https://stackoverflow.com/q/76557758/554319.
Is this behavior expected?
Originally posted by @astrojuanlu in #2690 (comment)
The text was updated successfully, but these errors were encountered: