Slackbot
03/17/2022, 2:52 PMVilhelm
03/17/2022, 2:58 PMIdo (Ploomber)
Ido (Ploomber)
Ido (Ploomber)
Eduardo
ploomber build -p random-forest
or ploomber build -p another
2. alternatively, you may parametrize a task and have that parameter determine the logic to execute inside the task. example:
tasks:
source: script.py
products: ...
params:
model: random-forest
then in your script.py:
if model == 'random-forest':
# do something
else:
# do another thing
3. Finally, if the logic is too different, you can create the common parts in a separate file and then use the import_tasks_from
directive https://docs.ploomber.io/en/latest/api/spec.html#import-tasks-from
thoughts @Raffaele Olmeda?Raffaele Olmeda
03/17/2022, 4:48 PMEduardo
Raffaele Olmeda
03/17/2022, 8:54 PMfollow-up question: โพ
Raffaele Olmeda
03/17/2022, 8:54 PMEduardo
source: F.py
, just add a name: some-name
to each oneEduardo
Eduardo
meta:
extract_upstream: false
tasks:
- source F.py
name: f-one
upstream: [D]
- source F.py
name: f-two
upstream: [E]
Raffaele Olmeda
03/17/2022, 9:02 PMIdo (Ploomber)