apache / airflow

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

XCOM value json viz - CamelCase keys #42029

Closed raphaelauv closed 2 months ago

raphaelauv commented 2 months ago

Apache Airflow version

2.10.0

What happened?

when I vizualize the XCOM in airflow UI , the keys are formatted in CamelCase

image

How to reproduce

from airflow import DAG
from airflow.operators.python import PythonOperator
from airflow.utils.dates import days_ago

with DAG(dag_id="test",
         start_date=days_ago(1),
         schedule=None):
    def toto():
        rst = []
        results_list = ["a", "b", "c", "d"]
        for index, item in enumerate(results_list):
            tmp = {
                "aaaaaaaa_bbbbbb": index,
                "cccccccc_dddddd": item
            }
            rst.append(tmp)

        return rst

    PythonOperator(
        task_id="a",
        python_callable=toto,
        do_xcom_push=True,
    )

Are you willing to submit PR?

Code of Conduct

jscheffl commented 2 months ago

Uuups, great catch... and this is serious. I tried to trace it down and it seems to be rooted in the automatically generated API client bindngs in JavaScript which use CamelCasedPropertiesDeep from the JSON response...

@bbovenzi do you know how the generated API can be influenced NOT to camelCase all objects received from public API?