Repository navigation
Fix API List DAGs inconsistent with UI/CLI - #16318
Conversation
ephraimbuddy
left a comment
There was a problem hiding this comment.
Can you add a test to avoid regression?
Sure thing, although I am not too sure how to reproduce this state/ explicitly test for this state. Do you have any recommendation? |
I think you can achieve it by marking dag inactive. DagModel.is_active exists, so many mark a dag inactive and another active |
There was a problem hiding this comment.
How about you add a query that asserts that the number of dags in DagModel is 3
There was a problem hiding this comment.
Number of DAGs in DagModel should exclude inactive DAGs, as far as I understand. In my opinion are inactive DAGs .trash and play no significant role.
There was a problem hiding this comment.
I know but how are we sure that an inactive dag exists here? Do we have a test for the new method you created? I think that querying DagModel and asserting that it has 3 dags(both active and inactive) at this point will help to know that the method you created works fine. If there's an alteration in the method in the future to work another way, it'll be noticed. What do you think?
|
@ephraimbuddy Is it possible to run the full CI suite? |
Once approved, it'll run more tests as needed |
|
Added @ephraimbuddy suggestions & rebased to master. |
|
The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest main or amend the last commit of the PR, and push it with --force-with-lease. |
|
@kaxil @ephraimbuddy Changes approved, checks passed and ready to merge. Thanks for the patience. |
|
Thanks @ephraimbuddy! |
|
Congrats on the PR @jpyen |
related: #16228
/api/v1/dagsshould yield the same output as the Web UI and CLI, namely:The current implementation does only list DAGs that the user has access to, but fails to get the true DAG bag list. Which means the API endpoint is showing many more, deleted DAGs, that the UI and Web CLI do not.