uranusjr commented on code in PR #54816:
URL: https://github.com/apache/airflow/pull/54816#discussion_r2302888036
##########
airflow-core/src/airflow/serialization/serialized_objects.py:
##########
@@ -1309,7 +1308,7 @@ def get_extra_links(self, ti: TaskInstance, name: str) ->
str | None:
link = self.operator_extra_link_dict.get(name) or
self.global_operator_extra_link_dict.get(name)
if not link:
return None
- return link.get_link(self.unmap(None), ti_key=ti.key) # type:
ignore[arg-type] # TODO: GH-52141 - BaseOperatorLink.get_link expects
BaseOperator but receives SerializedBaseOperator
+ return link.get_link(self, ti_key=ti.key) # type: ignore[arg-type] #
TODO: GH-52141 - BaseOperatorLink.get_link expects BaseOperator but receives
SerializedBaseOperator
Review Comment:
When the thing was original designed we _could_ get the original operator
class from a dag bag… but yeah I guess all these no longer apply now.
Now that we always do get_link in the worker
(https://github.com/apache/airflow/pull/54816#discussion_r2296262872), we can
always get the original operator class (you need to unmap for execution
anyway), so I guess what we need to do is
1. _Not_ have `extra_links` and `get_extra_links` on SerializedBaseOperator?
(since nobody should access these in the scheduler and webserver; the XCom
mnechanism should be used instead)
1. Make sure global links are also called and generated on execution time
1. Restore get_link to only be expect BaseOperator subclasses; may need to
tweak execution slightly to make sure it’s only called after a MappedOperator
is unmapped into a BaseOperator
--
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]