Skip to content

Downloaded task logs for taskgroup does not have .txt extension #57847

@atul-astronomer

Description

@atul-astronomer

Apache Airflow version

3.1.2rc1

If "Other Airflow 2/3 version" selected, which one?

No response

What happened?

User can now download the AF3 task logs from UI but downloaded task logs for taskgroup does not have .txt extension to the file and hence user is not able to open the file and see the logs.

Image

What you think should happen instead?

No response

How to reproduce

Run breeze on 3.1.2rc1 and run any taskgroup dag, navigate to the task logs and download the file, notice that file does not have .txt extension and hence user see a window asking how to open the file.

from datetime import datetime, timedelta

from airflow.sdk import DAG
from airflow.decorators import task
from airflow.providers.standard.operators.bash import BashOperator
from airflow.utils.task_group import TaskGroup

foo_var = {"VAR1": "FOO"}
bar_var = {"VAR1": "BAR"}
hi_cmd = 'echo "hello $VAR1"'
bye_cmd = 'echo "goodbye $VAR1"'


@task
def envs():
    return [foo_var, bar_var]


@task
def cmds():
    return [hi_cmd, bye_cmd]


with DAG(
    dag_id="mapped_bash_taskgroup",
    start_date=datetime(1970, 1, 1),
    schedule=None,
    tags=["taskmap"]
) as dag:

    with TaskGroup(group_id="dynamic"):
        dynamic = BashOperator.partial(task_id="bash").expand(
            env=envs(), bash_command=cmds()
        )

Operating System

Linux

Versions of Apache Airflow Providers

No response

Deployment

Other

Deployment details

No response

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions