Closed matterrr closed 6 months ago
No it's all good and consistent.
Theinclude_prior_dates
is good because it is used to do filtering (before selecting one
- latest in this case - is applied). So it's not about returned value but about XCom values that are considered as candidates. It's perfectly fine and consistent.
Apache Airflow version
2.8.2
If "Other Airflow 2 version" selected, which one?
No response
What happened?
The arg
include_prior_dates
inTaskInstance.xcom_pull()
has the following definition:In practice,
xcom_pull(key="<some_key>", include_prior_dates=True)
only returns a single xcom (the most recent prior DAG run) when only thekey
is specified. I think it would only return multiple xcoms if multipletask_ids
are specified, or the xcom(s) was pushed from a mapped task.What you think should happen instead?
I think that the
include_prior_dates
being plural implies thatxcom_pull(key="<some_key>", include_prior_dates=True)
should return anarray
of xcoms for alldag_runs
. This is even consistent with the wording in theget_many()
function called inxcom_pull()
:But strangely, the
get_one()
function inBaseXCom
has this wording:At the least, the wording
include_prior_dates
should be changed toinclude_prior_date
(singular) if xcoms from only the previous DAG run will ever be returned.How to reproduce
h3. Example Code
h3. Steps
None
for the first runxcom_pull()
only ever returns a single value from the previous DAG runOperating System
Debian GNU/Linux 11 (bullseye)
Versions of Apache Airflow Providers
No response
Deployment
Docker-Compose
Deployment details
No response
Anything else?
No response
Are you willing to submit PR?
Code of Conduct