jason810496 commented on code in PR #58102:
URL: https://github.com/apache/airflow/pull/58102#discussion_r2517435596
##########
airflow-core/src/airflow/api_fastapi/core_api/services/public/task_instances.py:
##########
@@ -120,23 +127,26 @@ def _patch_task_instance_state(
f"Task id {task_id} is already in {data['new_state']} state",
)
- for ti in updated_tis:
Review Comment:
How about using early return?
```python
if not commit:
return updated_tis
```
##########
airflow-core/src/airflow/api_fastapi/core_api/services/public/task_instances.py:
##########
@@ -261,6 +272,92 @@ def handle_bulk_update(
except HTTPException as e:
results.errors.append({"error": f"{e.detail}", "status_code":
e.status_code})
+ def handle_request_dry_run(self) -> TaskInstanceCollectionResponse:
Review Comment:
It seems the logic is almost same as `handle_bulk_update`.
Would it be better just to make sure all the operations in
`handle_bulk_update` respect `self.commit` instead of having
`handle_request_dry_run` to reuse most of the implementation?
--
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]