-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Add map_index to XCom's primary key and interface #21710
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
Conversation
Since the latest XCom migration has not been publicly released, this modifies that migration in place so we don't need to recreate the XCom primary key *again*. While I added the map_index argument to the functions, I'm honestly not sure how it can be used for most of the interfaces. Those can hopefully be added incrementally later.
f68f889 to
9479d88
Compare
|
Ah, adding |
airflow/models/xcom.py
Outdated
| dag_id: str, | ||
| task_id: str, | ||
| run_id: str, | ||
| map_index: int = -1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if instead of all these columns we should take a Union[TaskInstance, TaskInstanceKey]?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering about just TaskInstanceKey; it’s quite trivial to build a key from a ti anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's ti.key infact :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, I've started making this change and I'm not too sure about it. Will continue for now.
|
The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease. |
It's getting to the point where set/clear etc are taking entirely too many parameters and it's getting unwieldy, and we've already got a class that encapsulates this info.
|
Decided to fix up the Operator links first, so this depends on #21798 |
|
Easier to redo this one top of main instead of rebasing. |
Since the latest XCom migration has not been publicly released, this
modifies that migration in place so we don't need to recreate the XCom
primary key again.
While I added the map_index argument to the functions, I'm honestly not
sure how it can be used for most of the interfaces. Those can hopefully
be added incrementally later.