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

Reverse operation for glue #82

Open
mirekphd opened this issue Mar 13, 2021 · 2 comments
Open

Reverse operation for glue #82

mirekphd opened this issue Mar 13, 2021 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@mirekphd
Copy link

I started building[1] on an example from the docs here, but wasn't able to find a method to remove these sample Scraps added with glue:

sb.glue("hello", "world")
sb.glue("number", 123)
sb.glue("some_list", [1, 3, 5])
sb.glue("some_dict", {"a": 1, "b": 2})
sb.glue("non_json", df, 'pandas')

Does a reverse operation to glue exist? If not, will it be possible to add it to enable ungluing of unwanted Scraps from notebooks?


[1] a modeling "metapipeline" composed of several serially dependent "classic" modeling pipelines, all executed (using papermill) on the basis of the same template notebook (factory) and producing a model whose MLflow run ID (generated inside the output notebook) will be passed to the next modeling stage using a Scrap glued to the output notebook (which requires much less boilerplate than Luigi by the way, many thanks!)

@mirekphd
Copy link
Author

mirekphd commented Mar 13, 2021

I've just noticed that simply not calling glue for unwanted Scraps (e.g. by executing notebook cell with all unwanted glue calls commented out) and then saving the notebook will avoid glueing these unwanted Scraps (effectively deleting them / unglueing). Brilliant, and again consistent with the KISS principle!

@MSeal
Copy link
Member

MSeal commented Mar 15, 2021

@mirekphd You got the mechanism as it was intended. That being said adding an unglue function could be useful if one is inheriting some function implementation that adds scraps you don't want in the final size. I'll keep it as an enhancement request issue for future work.

@MSeal MSeal added enhancement New feature or request good first issue Good for newcomers labels Mar 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants