Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Serialization error in TaskCallbackRequest #25471

Merged
merged 2 commits into from Aug 2, 2022

Conversation

ephraimbuddy
Copy link
Contributor

@ephraimbuddy ephraimbuddy commented Aug 2, 2022

How we serialize SimpleTaskInstance in TaskCallbackRequest class leads to JSON serialization error when there's start_date or end_date in the task instance. Since there's always a start_date on tis, this would always fail.
This PR aims to fix this through a new method on the SimpleTaskInstance that looks for start_date/end_date and converts them to isoformat for serialization.

Closes: #25343

airflow/models/taskinstance.py Outdated Show resolved Hide resolved
@ashb
Copy link
Member

ashb commented Aug 2, 2022

Are we doing a 2.3.4 , or straight to 2.4.0 next?

@ephraimbuddy
Copy link
Contributor Author

Are we doing a 2.3.4 , or straight to 2.4.0 next?

I think it'll be good to do 2.3.4 due to some of these bugs

cc: @jedcunningham

How we serialize `SimpleTaskInstance `in `TaskCallbackRequest` class leads to JSON serialization error when there's start_date or end_date in the task instance. Since there's always a start_date on tis, this would always fail.
This PR aims to fix this through a new method on the SimpleTaskInstance that looks for start_date/end_date and converts them to isoformat for serialization.
@ephraimbuddy ephraimbuddy merged commit d7e14ba into apache:main Aug 2, 2022
@ephraimbuddy ephraimbuddy deleted the fix-serialization-error branch August 2, 2022 21:50
@ephraimbuddy ephraimbuddy added the type:bug-fix Changelog: Bug Fixes label Aug 2, 2022
@ephraimbuddy ephraimbuddy added this to the Airflow 2.3.4 milestone Aug 2, 2022
ephraimbuddy added a commit that referenced this pull request Aug 15, 2022
How we serialize `SimpleTaskInstance `in `TaskCallbackRequest` class leads to JSON serialization error when there's start_date or end_date in the task instance. Since there's always a start_date on tis, this would always fail.
This PR aims to fix this through a new method on the SimpleTaskInstance that looks for start_date/end_date and converts them to isoformat for serialization.

(cherry picked from commit d7e14ba)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug-fix Changelog: Bug Fixes
Projects
None yet
4 participants