Skip to content

API: Clarify docstrings and assert detail in Task State Store tests - #73939

Open
Kaap10 wants to merge 2 commits into
apache:mainfrom
Kaap10:test-task-state-store-docstring-detail
Open

Kaap10 wants to merge 2 commits into
apache:mainfrom
Kaap10:test-task-state-store-docstring-detail

Conversation

@Kaap10

@Kaap10 Kaap10 commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #73753 based on reviewer feedback from @henry3260 and @Eason09053360:

  1. Domain Exception Coverage for PUT:
    • Added test_set_task_state_store_domain_error_returns_404 using autospec=True on MetastoreBackend.set to verify domain-level ValueError translation parity with PATCH.
  2. Remove Redundant Tests:
    • Removed test_set_nonexistent_dag_run_returns_404 and test_set_nonexistent_task_id_returns_404 as their scope validation behavior is already tested under TestUnknownTaskInstance::test_returns_404.

related: #73753


Was generative AI tooling used to co-author this PR?
  • Yes - Antigravity

Generated-by: Antigravity following the guidelines


Follow-up to PR apache#73753:

In test_task_state_store.py, test_set_nonexistent_dag_run_returns_404
receives a 404 from _validate_scope rather than set()'s ValueError.
Update the docstrings to clarify this behavior, assert on the 404
detail message, and add test_set_task_state_store_domain_error_returns_404
to verify ValueError translation parity for PUT.
@boring-cyborg boring-cyborg Bot added the area:API Airflow's REST/HTTP API label Sep 30, 2026

@Eason09053360 Eason09053360 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the patch!
LGTM :)

@Eason09053360 Eason09053360 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One suggestion. Feel free to resolve it!

Remove test_set_nonexistent_dag_run_returns_404 and
test_set_nonexistent_task_id_returns_404 from TestSetTaskState as their
exact assertions and URLs are already parametrized and tested in
TestUnknownTaskInstance.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants