OscarLigthart commented on PR #62812: URL: https://github.com/apache/airflow/pull/62812#issuecomment-4027342056
> Thanks for the PR. > > Can you add query guards to tests (`assert_queries_count`) . I'm afraid this will generate N+1 queries problem -> Number of db request will scale linearly with the number of TIs in the group. And we should rework the code not do do that. > > Also I find the code overly complicated with numerous duplicated call made at different abstraction level because of function nesting, it makes the whole thing hard to understand and probably sub optimal. Thanks for the detailed review! I think the points made a lot of sense. Apologies for this oversight on my side. I tried following the implementation of the other PR more, removing the BulkTaskInstanceService usage and solving the N+1 query problem. I still opted to keep them in separate endpoints for clarity. Let me know if you disagree! Also happy to cast this aside and wait for the other PR to be picked up again, if that is more in line with your preference. One question regarding the `assert_queries_count`, I've create multiple cases where they remain the same, effectively eliminating the query problem, but I'm guessing there's many things that can impact this amount. In turn, this would break the tests implemented here. Is there a specific rule to keep in mind when applying it? Or is just setting it in the way I do in the test correct? -- 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]
