AIP-84 Migrate Clear Dag Run public endpoint to FastAPI #42975
AIP-84 Migrate Clear Dag Run public endpoint to FastAPI #42975pierrejeambrun merged 24 commits intoapache:mainfrom
Conversation
a418bcf to
4fc16f1
Compare
|
@pierrejeambrun , I noticed that in legacy implementation, for clear dag run endpoint with dry_run=True, the response is supposed to be a TaskInstanceCollection. However, the response only includes few attributes of TI. Below is an example response : Related schema: TaskInstanceReferenceSchema I tried to return all details. But, to do that, it seems I can't reuse the methods in the legacy implementation as it is causing the following error. I guess, I just need to use joinload. But, thinking if I should update here or just rewrite a select query within clear_dag_run method |
|
I think we can do the same and return a partial response. There is a way to do that in fastapi specifying the response model. And we need to document it in the swagger with example responses. DetachedInstance error is most certainly due to a bad session handling. (session used to fetch objects is closed too early or something similar) |
I went with returning the entire object. Is that fine? If not, I can return the partial response. I already looked into how to do it |
pierrejeambrun
left a comment
There was a problem hiding this comment.
Nice!
A few suggestions/questions
Co-authored-by: Pierre Jeambrun <[email protected]>
Co-authored-by: Pierre Jeambrun <[email protected]>
pierrejeambrun
left a comment
There was a problem hiding this comment.
Nice, a few minor suggestions and ready to merge, thanks
* add clear_dag_run * add tests * Merge branch 'main' of https://github.com/apache/airflow into kalyan/API-84/clear_dag_run * add ti response * add * use logical_date * fix tests * remove async * Update airflow/api_fastapi/core_api/routes/public/dag_run.py Co-authored-by: Pierre Jeambrun <[email protected]> * Update airflow/api_fastapi/core_api/datamodels/dag_run.py Co-authored-by: Pierre Jeambrun <[email protected]> * remove type ignore * update ti state and assert it * reuse state * remove breakpoint * feedback --------- Co-authored-by: Pierre Jeambrun <[email protected]>
related to #42701