Skip to content

execution_date format #40308

Answered by raphaelauv
HumanIearning asked this question in Q&A
Jun 18, 2024 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

yes , you can convert it by

from pendulum import DateTime
def cast_pendulum_date(date: DateTime) -> str:
    return date.format("YYYY-MM-DD HH:mm:ss+00:00")
DAG(
...
user_defined_macros={
            "cast_pendulum_date": cast_pendulum_date
        }
)

...


        PythonOperator(
            task_id="XXXX",
            python_callable=XXXX,
            do_xcom_push=True,
            op_kwargs={
                "date": "{{ cast_pendulum_date(logical_date) }}",
            },
        )

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@HumanIearning
Comment options

Answer selected by HumanIearning
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
kind:bug This is a clearly a bug area:core
3 participants
Converted from issue

This discussion was converted from issue #40292 on June 18, 2024 18:03.