potiuk commented on PR #27196:
URL: https://github.com/apache/airflow/pull/27196#issuecomment-1287674610
I'd love @uranusjr if you take a look as well. The biggest part of pre-2.3
was removal of dttm from "XCom.get_value" - mostly in operator links.
Also I am not sure if what I've done is correct. I assumed that after
migration to 2.3 each task instance will have a "task_instance_key" and we will
be able to use task instance key and `get_value` even for task instances
created in previous Airflow versions (I believe migration takes care about it).
I would love your comments here @uranusjr if I understood correctly that we
should genereally skip all the dttm usage and rely on task_instance_key being
always present.
I have found however one case where it is not as straightforward and dttm is
still used and I am not sure if we want to do anything about it:
```
class ExternalDagLink(BaseOperatorLink):
"""
Operator link for ExternalTaskSensor and ExternalTaskMarker.
It allows users to access DAG waited with ExternalTaskSensor or cleared
by ExternalTaskMarker.
"""
name = 'External DAG'
def get_link(self, operator, dttm):
ti = TaskInstance(task=operator, execution_date=dttm)
operator.render_template_fields(ti.get_template_context())
query = {"dag_id": operator.external_dag_id, "execution_date":
dttm.isoformat()}
return build_airflow_url_with_query(query)
```
In all the other cases I converted 'get_link" to
```
def get_link(
self,
operator: BaseOperator,
*,
ti_key: TaskInstanceKey,
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]