Ability to tag tasks?
#17697
Replies: 1 comment 9 replies
-
|
Tags are available at dag, not at task levels. But what I can suggest is a
naming convention for task_ids. That should do pretty well.
…On Wed, Aug 18, 2021 at 9:15 PM Philippe Hebert ***@***.***> wrote:
I'm currently building a dag that self-populates its tasks based on the
files (py, ipynb) of a directory.
I would like to access the xcom of all of those tasks once they are
executed in order to retrieve their result from S3/GCS and then combine
them in memory to assemble a finalized file.
Currently since these tasks are all of the same Operator type, I use the
Operator type to filter the list of upstream tasks, but I plan to expand to
different Operator types. While I could expand the list of Operator types
that are filtered, I figured task tags would be cleaner.
I looked into the impl of BaseOperator, PythonOperator and some provider
operators, and I couldn't find anything that looked like tags. The closest
I found was the use of op_kwargs/op_args for PythonOperator, but not all
operators have these parameters.
Hence:
1. Is there any way to tag operators? Alternatively I can monkey-patch
tags on my operators, but that sounds hacky and dangerous.
2. Is this something that was considered in the past and decided
against?
3. Any better solution?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#17697>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAERMI7CY6BUBUCC2KQLXPLT5QBDXANCNFSM5CMVVEUQ>
.
--
+48 660 796 129
|
Beta Was this translation helpful? Give feedback.
9 replies
Answer selected by
p-hebert
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm currently building a dag that self-populates its tasks based on the files (py, ipynb) of a directory.
I would like to access the xcom of all of those tasks once they are executed in order to retrieve their result from S3/GCS and then combine them in memory to assemble a finalized file.
Currently since these tasks are all of the same Operator type, I use the Operator type to filter the list of upstream tasks, but I plan to expand to different Operator types. While I could expand the list of Operator types that are filtered, I figured task tags would be cleaner.
I looked into the impl of BaseOperator, PythonOperator and some provider operators, and I couldn't find anything that looked like tags. The closest I found was the use of op_kwargs/op_args for PythonOperator, but not all operators have these parameters.
Hence:
Beta Was this translation helpful? Give feedback.
All reactions