Hi ! I was surprised to discover that the `pipelin...
# questions
Hi ! I was surprised to discover that the
object does not have a
attribute (as opposed to
) It would have come in handy to "restrict" certain hooks to certain pipelines. The only hack I can come up with is to identify pipelines by the name of their nodes ? Is there another / better way ? Thx M.
Hey Marc, you can use the before_pipeline_run hook
You are correct pipeline does not come with name because it is a collection of nodes, summing pipelines will result in ambigirous names.
Yeah it might not be clear the difference between a ‘registered pipeline name’ i.e. an entrypoint and an instance of a pipeline object, as Nok says you need the lifecycle of a run (exposed via a hook) to contextualise a running pipeline’s name
Thanks @Nok Lam Chan & @datajoely i've tried to hack my way around by monkey patching the pipeline objects in the pipeline dict defined in
with :
Copy code
for name, object_ in pipelines.items():
       setattr(object_, 'name', name)
What surprises me is that this works within the context of / will running the
but when I tried to access to the monkey-patched pipeline name in
in end up with an
AttributeError: 'Pipeline' object has no attribute 'name'
What am I missing / getting wrong regarding the lifecycle ?
Was on holiday. Patching attribute is not robust because filtering pipeline effectively create new pipeline object.