Skip to content

Add team name to dag attributes and task context variables #65465

@stephen-bracken

Description

@stephen-bracken

Description

When running in multi team mode we should pass the team name that the task belongs to into the TaskInstance context variables, and possibly add a DAG.team_name attribute. This would be useful for setting team level policies in the airflow_local_settings.py hooks.

Use case/motivation

Setting team level policies for tasks, dags in airflow_local_settings.py and providing team template variables using jinja2, e.g. {{ ti.team_name }}, {{ dag.team_name }} or just {{ team_name }}. This would allow us to create team separated log file paths in the log_file_nametemplate config setting with their own team specific access policies.

Related issues

No response

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions