Keep a data-frame transform's collect off the request worker - #855
Open
CleanCut wants to merge 1 commit into
Open
Keep a data-frame transform's collect off the request worker#855CleanCut wants to merge 1 commit into
CleanCut wants to merge 1 commit into
Conversation
`tabular::transform` ends in an eager, frame-sized polars collect that ran on whatever runtime called it. Fourteen production call sites await it, several of them inside HTTP handlers, so a request worker sat through the whole collect and picked up nothing else while it ran. The collect now runs inside `spawn_blocking`, matching the closure `add_row` already uses. The signature is unchanged, so no call site moves. `transform_lazy`, a few lines below, documents the rule this was missing: eager polars work belongs inside `spawn_blocking`. Its own filter and take branches honor it, as do `add_col_lazy` and `add_row`; this tail was the one link without an offload. Only the tail moves — `transform_lazy` stays async because its vstack and sql branches await, and flattening those is a larger change. No benchmark accompanies this. The frame is already materialized, so the cost being removed is worker occupancy, not a crash risk. ENG-1432
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughSummary by CodeRabbit
Walkthrough
ChangesTabular transformation execution
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
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.
Move sync work into a thread so it doesn't block the async request worker.
ENG-1432