Vamsi-klu commented on code in PR #66681:
URL: https://github.com/apache/airflow/pull/66681#discussion_r3282282860
##########
providers/databricks/src/airflow/providers/databricks/operators/databricks.py:
##########
@@ -1367,7 +1367,7 @@ def _get_current_databricks_task(self) -> dict[str, Any]:
def _convert_to_databricks_workflow_task(
self,
- relevant_upstreams: list[BaseOperator],
+ relevant_upstreams: list[str],
Review Comment:
Good catch. This is correcting the annotation to match the runtime value
rather than changing behavior.
`relevant_upstreams` is populated from `task.task_id` in
`DatabricksWorkflowTaskGroup.__exit__`, so it is a list of task-id strings.
`_convert_to_databricks_workflow_task()` then compares those strings with
`self.upstream_task_ids`:
```python
for task_id in self.upstream_task_ids
if task_id in relevant_upstreams
```
The old `list[BaseOperator]` annotation was misleading: passing operators
there would make that membership check fail because it compares `str` task IDs
to operator objects. The actual `BaseOperator` instances are still carried
separately in `task_dict`, which is used when resolving the parent task’s
Databricks task key.
So this change is mainly a type-hint cleanup that also makes the tests
reflect the real call shape.
--
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]