Repository navigation
Migrate Execution API asset event routes to async DB session - #77736
Open
RehanAhmad25 wants to merge 2 commits into
Open
RehanAhmad25 wants to merge 2 commits into
RehanAhmad25 wants to merge 2 commits into
Conversation
RehanAhmad25
requested review from
amoghrajesh,
ashb,
bugraoz93,
choo121600,
ephraimbuddy,
henry3260,
jason810496,
pierrejeambrun and
shubhamraj-git
as code owners
November 28, 2026 19:29
13 of 57 tasks
Contributor
Author
|
@Dev-iL could you approve the workflow runs when you get a chance? Thanks! |
Collaborator
I believe thst require a maintainer. My abilities are limited to adding/removing tags. |
Contributor
Author
Got it, thanks for clarifying! Would also appreciate a review whenever you have time. |
Contributor
Author
|
Did a self-review pass and pushed a few fixes in 669c61f:
Re-tested:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #67799
Converts the two routes in
execution_api/routes/asset_events.pyto async:What changed
async defwithAsyncSessionDep. The query addsselectinloadforAssetEvent.assetandAssetEvent.created_dagruns, since both are lazy and the response reads them. Full entities are kept because the response needs every event field, four asset fields and the dag run list.partition_key_regexp_patternfilter's dependency took a syncSessionDepand appliedapply_regex_query_timeoutto it. Left as is, the async route would run its query on a different session than the one carrying the timeout. Added async counterparts next to the sync ones:apply_regex_query_timeout_async,aregex_param_factoryandQueryAssetEventPartitionKeyRegexAsync. The core API keeps using the sync versions. Pattern validation moved into a small shared_build_regex_paramso both factories behave the same.Tests
apply_regex_query_timeout_asyncandaregex_param_factory, mirroring the sync ones.Command:
pyteston the twotest_asset_events.pyfiles,common/test_parameters.py,utils/test_sqlalchemy.pyandcore_api/routes/public/test_assets.py.Note
A regex request opens two sessions: Cadwyn solves the dependency once on its own and once sharing the route's session. I checked the base revision and it does the same with the sync dependency, so this PR keeps parity; the query is still covered by the timeout. Happy to look at skipping the first pass in a follow-up if that's wanted.
I haven't run the event loop stall harness from the SKILL. These routes return all events by default, so I can add a measurement if reviewers want one.
Was generative AI tooling used to co-author this PR?
Generated-by: Claude (Anthropic) following the guidelines