Skip to content

Manual triggering of DAG with object Param having empty default value fails #47104

@vikmary

Description

@vikmary

Apache Airflow version

2.10.5

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

No response

What happened?

If a DAG contains "object" Param having valid empty dictionary {} as default, then the manual triggering for it doesn't succeed. In this case, If I push "Trigger" button in UI, it just doesn't react.

What you think should happen instead?

The DAG should trigger with Param having {} value.

How to reproduce

from airflow import DAG                                                                                                                                                                                                                                   
from airflow.operators.dummy import DummyOperator                                                                                                                                                                                                         
from airflow.models import Param                                                                                                                                                                                                                          
                                                                                                                              
with DAG(                                                                                                                                                                                                                                                 
    "run-test",                                                                                                                                                                                                                                           
    params={                                                                                                                                                                                                                                              
        "object_param": Param({}, type="object", description="Object field"),                                                                                                                                                                                                                                                
    },                                                                                                                                                                                                                                                    
    schedule=None,                                                                                                                                                                                                                                        
    catchup=False,                                                                                                                                                                                                                                        
 ) as dag:                                                                                                                                                                                                                                                 
    DummyOperator(task_id="dummy_task")   

Operating System

Ubuntu 22.04.4 LTS

Versions of Apache Airflow Providers

apache-airflow-providers-common-compat==1.3.0
apache-airflow-providers-common-io==1.5.0
apache-airflow-providers-common-sql==1.21.0
apache-airflow-providers-fab==1.5.2
apache-airflow-providers-ftp==3.12.0
apache-airflow-providers-http==5.0.0
apache-airflow-providers-imap==3.8.0
apache-airflow-providers-smtp==1.9.0
apache-airflow-providers-sqlite==4.0.0

Deployment

Virtualenv installation

Deployment details

Installation and setup script

#!/bin/bash

set -ex

AIRFLOW_HOME=~/airflow
ENV_NAME=airflow-env

function install_python {
    apt-get update
    apt-get -y install python3.10 python3.10-venv
}

function create_virtualenv {
    python3.10 -m venv $ENV_NAME
    source $ENV_NAME/bin/activate
    pip install --upgrade pip
    pip install apache-airflow==2.10.5 --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.10.5/constraints-3.10.txt"
}

function configure_airflow {
    export AIRFLOW_HOME=$AIRFLOW_HOME
    export AIRFLOW__CORE__DAGS_FOLDER=./pipelines
    export AIRFLOW__CORE__LOAD_EXAMPLES=False
    export AIRFLOW__DATABASE__LOAD_DEFAULT_CONNECTIONS=False
    airflow config list > "${AIRFLOW_HOME}/airflow.cfg"
}

mkdir -p $AIRFLOW_HOME
cd $AIRFLOW_HOME

install_python
create_virtualenv
configure_airflow

airflow standalone

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

    area:UIRelated to UI/UX. For Frontend Developers.area:corekind:bugThis is a clearly a bugneeds-triagelabel for new issues that we didn't triage yet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions