Skip to content

Task-level params in HITLOperator are merged with DAG params and cannot be hidden in UI #57498

@jgoedeke

Description

@jgoedeke

Apache Airflow version

3.1.1

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

No response

What happened?

The HITLOperator UI form always shows DAG params. I found no way to hide DAG params for a HITLOperator task.

from airflow.providers.standard.operators.hitl import HITLOperator
from airflow.sdk import dag

dag_params = {
    'dag_param1': 'value1',
    'dag_param2': 'value2',
}

@dag(
    schedule=None,
    params=dag_params,
)
def validate_hitl_operator_params_taskflow():
    HITLOperator(
        task_id='task_without_params',
        subject='Please choose an option:',
        options=['Option A', 'Option B'],
    )

    HITLOperator(
        task_id='task_with_params',
        subject='Please choose an option:',
        options=['Option X', 'Option Y'],
        params={'task_param': 'value'},
    )

validate_hitl_operator_params_taskflow()
Image Image

What you think should happen instead?

The HITLOperator params should be independent from DAG params. The "Required Action" should only show explicitly specified params.

How to reproduce

Run above provided DAG and go to "Required Actions"

Operating System

docker

Versions of Apache Airflow Providers

No response

Deployment

Docker-Compose

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

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions