travis-cook-sfdc opened a new issue, #28870:
URL: https://github.com/apache/airflow/issues/28870
### Description
`BaseOperatorLink` should support returning multiple links:
```
class ButtonLink::
def __init__(self, name: str, link: str) -> None:
self.name = name
self.link = link
class BaseOperatorLink(metadataclass=ABCMeta):
...
@abstractmethod
def get_links(self, operator: BaseOperator, dttm: datetime) ->
List[ButtonLink]:
pass
```
### Use case/motivation
My company has implemented a "MultiExternalTaskSensor" that allows a single
task to wait for multiple other tasks to complete.
`ExternalTaskSensor` automatically supports `operator_extra_links` to
provide a link to the upstream DAG page, but this is impossible to do with
`Multi...` since there's an arbitrary number of buttons that need to show up
based on the number of tasks that are being waited on.
Another benefit of allowing this would be that the buttons could support
dynamic names, which would allow information about the task (like it's state)
to present in the button text.
This would add an additional challenge while the button data was loading,
since the name might not be known. At this point, there could either be a
default name fallback or a simple loading spinner while we wait for all button
names to return.
There would need to be changes to the `/extra_links` API and `dag.js`, but
it seems feasible.
It could be implement along the lines of:
```python
class ButtonLink:
def __init__(self, name: str, link: str) -> None:
self.name = name
self.link = link
class BaseOperatorLink(metaclass=ABCMeta):
...
@abstractmethod
def get_links(self, operator: BaseOperator, dttm: datetime) ->
List[ButtonLink]:
pass
```
### Related issues
_No response_
### Are you willing to submit a PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
--
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]