apache / airflow

Apache Airflow - A platform to programmatically author, schedule, and monitor workflows
https://airflow.apache.org/
Apache License 2.0
36.7k stars 14.21k forks source link

Wrong display of XCOM for boolean False value #42096

Closed Pad71 closed 1 week ago

Pad71 commented 1 month ago

Apache Airflow version

Other Airflow 2 version (please specify below)

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

2.10.1

What happened?

There was a bug in version 2.10 when displaying xcom values in the UI. It should have been fixed - see https://github.com/apache/airflow/pull/41516.

However, the problem persists for boolean False values (see images below). For True - xcom displays correct value image

For False - xcom displays wrong value image

Test Dag Code:

from datetime import datetime
from airflow import DAG
from airflow.operators.python import PythonOperator

# DAG Definition
with DAG(
    dag_id="TEST_XCOM_BOOLEANS",
    schedule = None,
    start_date = datetime(2024, 9, 8),
) as dag:

    def return_true():
        return True 

    true_task = PythonOperator(
        task_id = 'true_task',
        python_callable = return_true,
        trigger_rule = 'none_failed',
    )

    def return_false():
        return False    

    false_task = PythonOperator(
        task_id = 'false_task',
        python_callable = return_false,
        trigger_rule = 'none_failed',
    )   

What you think should happen instead?

For False value it should display "False" and not "Value is NULL"

How to reproduce

Run Dag (see the code below)

Test Dag Code:

from datetime import datetime
from airflow import DAG
from airflow.operators.python import PythonOperator

# DAG Definition
with DAG(
    dag_id="TEST_XCOM_BOOLEANS",
    schedule = None,
    start_date = datetime(2024, 9, 8),
) as dag:

    def return_true():
        return True 

    true_task = PythonOperator(
        task_id = 'true_task',
        python_callable = return_true,
        trigger_rule = 'none_failed',
    )

    def return_false():
        return False    

    false_task = PythonOperator(
        task_id = 'false_task',
        python_callable = return_false,
        trigger_rule = 'none_failed',
    )   

Operating System

Kubernetes on Unix platform

Versions of Apache Airflow Providers

No response

Deployment

Official Apache Airflow Helm Chart

Deployment details

No response

Anything else?

No response

Are you willing to submit PR?

Code of Conduct

raphaelauv commented 1 week ago

fix was merge, @Pad71 can you close the issue ?

Pad71 commented 1 week ago

@raphaelauv DOne :)