Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix KeyError when accessing retry_delay on MappedOperator without explicit value#56605

Merged
kaxil merged 3 commits intoapache:mainfrom
dheerajturaga:bugfix/mapped-ti-retry-delay
Oct 15, 2025
Merged

Fix KeyError when accessing retry_delay on MappedOperator without explicit value#56605
kaxil merged 3 commits intoapache:mainfrom
dheerajturaga:bugfix/mapped-ti-retry-delay

Conversation

Copy link
Member

dheerajturaga commented Oct 14, 2025 *
edited
Loading

When querying the API endpoint for mapped tasks (e.g., /api/v2/dags/{dag_id}/tasks/{task_id}),
the server returned a 500 Internal Server Error if the mapped task didn't have an explicit
retry_delay set. The retry_delay property was using direct dictionary access which raised
a KeyError during serialization.

Changed to use .get() with the default value from SerializedBaseOperator (300 seconds)

, 'ctx': {'error': "KeyError: 'retry_delay'"}}">INFO: 172.18.0.1:47834 - "GET /api/v2/dags/example_dv_simulation_flow/tasks/run_simulation HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application

raise ResponseValidationError(
fastapi.exceptions.ResponseValidationError: 1 validation errors:
{'type': 'get_attribute_error', 'loc': ('response', 'retry_delay'), 'msg': "Error extracting attribute: KeyError: 'retry_delay'", 'input': , 'ctx': {'error': "KeyError: 'retry_delay'"}}

cc: @kaxil , @vatsrahul1001

...licit value

When querying the API endpoint for mapped tasks (e.g., /api/v2/dags/{dag_id}/tasks/{task_id}),
the server returned a 500 Internal Server Error if the mapped task didn't have an explicit
retry_delay set. The retry_delay property was using direct dictionary access which raised
a KeyError during serialization.

Changed to use .get() with the default value from SerializedBaseOperator (300 seconds)
dheerajturaga requested a review from uranusjr as a code owner October 14, 2025 00:04
Copy link
Member

kaxil commented Oct 14, 2025 *
edited
Loading

@dheerajturaga Was the issue you saw on main or 3.1.0? Would be good to add a test case too

kaxil added this to the Airflow 3.1.1 milestone Oct 14, 2025
Copy link
Member Author

dheerajturaga commented Oct 14, 2025

@dheerajturaga Was the issue you saw on main or 3.1.0? Would be good to add a test case too

I noticed this on main

kaxil approved these changes Oct 14, 2025
Copy link
Member

kaxil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need a test addition, otherwise lgtm

shahar1 reacted with thumbs up emoji
amoghrajesh reviewed Oct 14, 2025
dheerajturaga force-pushed the bugfix/mapped-ti-retry-delay branch from bfca09c to aa6d79b Compare October 15, 2025 22:33
kaxil reviewed Oct 15, 2025
kaxil reviewed Oct 15, 2025
kaxil merged commit 1ab5bb6 into apache:main Oct 15, 2025
61 checks passed
kaxil pushed a commit that referenced this pull request Oct 16, 2025
...licit value (#56605)

When querying the API endpoint for mapped tasks (e.g., /api/v2/dags/{dag_id}/tasks/{task_id}),
the server returned a 500 Internal Server Error if the mapped task didn't have an explicit
retry_delay set. The retry_delay property was using direct dictionary access which raised
a KeyError during serialization.

Changed to use .get() with the default value from SerializedBaseOperator (300 seconds)

(cherry picked from commit 1ab5bb6)
snreddygopu pushed a commit to Teradata/airflow that referenced this pull request Oct 16, 2025
...licit value (apache#56605)

When querying the API endpoint for mapped tasks (e.g., /api/v2/dags/{dag_id}/tasks/{task_id}),
the server returned a 500 Internal Server Error if the mapped task didn't have an explicit
retry_delay set. The retry_delay property was using direct dictionary access which raised
a KeyError during serialization.

Changed to use .get() with the default value from SerializedBaseOperator (300 seconds)
abdulrahman305 bot pushed a commit to qenex-ai/airflow that referenced this pull request Oct 17, 2025
...licit value (apache#56605)

When querying the API endpoint for mapped tasks (e.g., /api/v2/dags/{dag_id}/tasks/{task_id}),
the server returned a 500 Internal Server Error if the mapped task didn't have an explicit
retry_delay set. The retry_delay property was using direct dictionary access which raised
a KeyError during serialization.

Changed to use .get() with the default value from SerializedBaseOperator (300 seconds)
abdulrahman305 bot pushed a commit to qenex-ai/airflow that referenced this pull request Oct 19, 2025
...licit value (apache#56605)

When querying the API endpoint for mapped tasks (e.g., /api/v2/dags/{dag_id}/tasks/{task_id}),
the server returned a 500 Internal Server Error if the mapped task didn't have an explicit
retry_delay set. The retry_delay property was using direct dictionary access which raised
a KeyError during serialization.

Changed to use .get() with the default value from SerializedBaseOperator (300 seconds)
TyrellHaywood pushed a commit to TyrellHaywood/airflow that referenced this pull request Oct 22, 2025
...licit value (apache#56605)

When querying the API endpoint for mapped tasks (e.g., /api/v2/dags/{dag_id}/tasks/{task_id}),
the server returned a 500 Internal Server Error if the mapped task didn't have an explicit
retry_delay set. The retry_delay property was using direct dictionary access which raised
a KeyError during serialization.

Changed to use .get() with the default value from SerializedBaseOperator (300 seconds)
potiuk mentioned this pull request Nov 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

kaxil kaxil approved these changes

amoghrajesh amoghrajesh left review comments

uranusjr Awaiting requested review from uranusjr uranusjr is a code owner

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

Airflow 3.1.1

Development

Successfully merging this pull request may close these issues.

3 participants