Kaap10 opened a new pull request, #77372:
URL: https://github.com/apache/airflow/pull/77372
<!-- SPDX-License-Identifier: Apache-2.0
https://www.apache.org/licenses/LICENSE-2.0 -->
Follow-up to #77146.
Per `airflow-core/src/airflow/api_fastapi/execution_api/AGENTS.md`:
> "When a client method does more than send a request and parse the reply
(it maps a status code to an ErrorResponse, parses a header, or falls back to
another request), add a test to test_task_sdk_client_contract.py."
This PR adds contract test coverage for `AssetOperations` and
`DagRunOperations` in `test_task_sdk_client_contract.py`:
1. **`TestAssetOperations`**:
- `test_get`: Retrieves active assets by `name` or `uri`, returning
`AssetResponse`.
- `test_get_not_found`: Verifies HTTP 404 from `/assets/by-name` or
`/assets/by-uri` is mapped to `ErrorResponse(error=ErrorType.ASSET_NOT_FOUND,
detail=params)`.
2. **`TestDagRunOperations`**:
- `test_trigger_success`: Triggers a new Dag run, returning
`OKResponse(ok=True)`.
- `test_trigger_already_exists`: Verifies HTTP 409 from
`/dag-runs/{dag_id}/{run_id}` is mapped to
`ErrorResponse(error=ErrorType.DAGRUN_ALREADY_EXISTS)` when
`reset_dag_run=False`.
- `test_trigger_already_exists_reset`: Verifies triggering an existing
run with `reset_dag_run=True` clears and returns `OKResponse(ok=True)`.
related: #77146
---
##### Was generative AI tooling used to co-author this PR?
- [x] Yes - Antigravity
Generated-by: Antigravity following [the
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]