Uh oh!
There was an error while loading. Please reload this page.
AIP-84 Migrate Clear Dag Run public endpoint to FastAPI - #42975
Conversation
a418bcf to
4fc16f1Compare…API-84/clear_dag_run
…API-84/clear_dag_run
…API-84/clear_dag_run
…API-84/clear_dag_run
@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) |
…API-84/clear_dag_run
…API-84/clear_dag_run
Uh oh!
There was an error while loading. Please reload this page.
rawwar
commented
Nov 8, 2024
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 |
…API-84/clear_dag_run
…API-84/clear_dag_run
pierrejeambrun
left a comment
There was a problem hiding this comment.
Nice!
A few suggestions/questions
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com>
Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com>
…API-84/clear_dag_run
pierrejeambrun
left a comment
There was a problem hiding this comment.
Nice, a few minor suggestions and ready to merge, thanks
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
* 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 <pierrejbrun@gmail.com> * Update airflow/api_fastapi/core_api/datamodels/dag_run.py Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com> * remove type ignore * update ti state and assert it * reuse state * remove breakpoint * feedback --------- Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com>
related to #42701