Feat/async map op - #37
Merged
Merged
Conversation
added 2 commits
July 23, 2026 15:13
…ission - Updated the `run_map` function to include a `sync` parameter, allowing users to choose between waiting for operation completion or returning the operation object immediately. - Revised the function's docstring to clarify the behavior based on the `sync` parameter, improving usability and documentation accuracy. - Ensured backward compatibility by maintaining the original behavior when `sync` is set to True.
Reviewer's GuideAdd an optional asynchronous mode to run_map that returns the YT Operation without waiting, and update tests and lint configuration accordingly. Sequence diagram for async mode in run_mapsequenceDiagram
actor Client
participant run_map
participant yt_client
Client->>run_map: run_map(sync)
alt [sync=True]
run_map->>yt_client: wait_for_operation(operation)
yt_client-->>run_map: success
run_map-->>Client: bool
else [sync=False]
run_map-->>Client: Operation
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Returning
bool | Operationfromrun_mapbased on thesyncflag can make call sites harder to reason about; consider either splitting this into two functions or returning a single consistent type (e.g., alwaysOperationand letting callers decide whether to wait). - The new async path bypasses
wait_for_operation, so any logging/metrics or error handling tied to completion will be skipped; if those are important, consider providing a helper or callback mechanism for tracking async operation completion outside this function.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Returning `bool | Operation` from `run_map` based on the `sync` flag can make call sites harder to reason about; consider either splitting this into two functions or returning a single consistent type (e.g., always `Operation` and letting callers decide whether to wait).
- The new async path bypasses `wait_for_operation`, so any logging/metrics or error handling tied to completion will be skipped; if those are important, consider providing a helper or callback mechanism for tracking async operation completion outside this function.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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.
Summary by Sourcery
Add optional asynchronous mode to the YT map operation helper while updating lint configuration.
New Features:
Enhancements:
Build:
Tests: