You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 28, 2025. It is now read-only.
Parametrizing a notebook on parameters={"list_param": [0,1], "tuple_param": (0,1)} will result in list_param value being injected as a list, but the tuple_param value being injected as the stringified representation of a tuple, e.g. "(0, 1)" (literally with the quotes). I understand that ploomber-engine strives to match the papermill API, so maybe this is intentional to maintain that compatibility, but is there a chance for the parameter translator to faithfully inject tuples?
Maybe a more sensible request would be to allow the user to pass a custom Translator to PloomberClient, which could pass the custom Translator subclass to parametrize_notebook (below), allowing the user to customize behavior, in the case that it is desired to mimic the papermill API surface by default?
Contents of translate
Here we see that tuple falls through to the "last resort" translator which stringifies it.
Parametrizing a notebook on
parameters={"list_param": [0,1], "tuple_param": (0,1)}will result inlist_paramvalue being injected as a list, but thetuple_paramvalue being injected as the stringified representation of atuple, e.g."(0, 1)"(literally with the quotes). I understand thatploomber-enginestrives to match thepapermillAPI, so maybe this is intentional to maintain that compatibility, but is there a chance for the parameter translator to faithfully inject tuples?Maybe a more sensible request would be to allow the user to pass a custom
TranslatortoPloomberClient, which could pass the customTranslatorsubclass toparametrize_notebook(below), allowing the user to customize behavior, in the case that it is desired to mimic thepapermillAPI surface by default?Contents of
translateHere we see that
tuplefalls through to the "last resort" translator which stringifies it.ploomber-engine/src/ploomber_engine/_translator.py
Lines 76 to 95 in e00bdc2
Abbreviated contents of
parametrize_notebookploomber-engine/src/ploomber_engine/_util.py
Lines 72 to 73 in e00bdc2
ploomber-engine/src/ploomber_engine/_util.py
Lines 92 to 94 in e00bdc2