Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion airflow/providers/databricks/operators/databricks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,15 @@ def _get_hook(self, caller: str) -> DatabricksHook:

def _get_databricks_task_id(self, task_id: str) -> str:
"""Get the databricks task ID using dag_id and task_id. Removes illegal characters."""
return f"{self.dag_id}__{task_id.replace('.', '__')}"
task_id = f"{self.dag_id}__{task_id.replace('.', '__')}"
if len(task_id) > 100:
self.log.warning(
"The generated task_key '%s' exceeds 100 characters and will be truncated by the Databricks API. "
"This will cause failure when trying to monitor the task. task_key is generated by ",
"concatenating dag_id and task_id.",
task_id,
)
return task_id

@property
def _databricks_workflow_task_group(self) -> DatabricksWorkflowTaskGroup | None:
Expand Down