Dev - #38
Merged
Merged
Conversation
added 2 commits
July 23, 2026 15:33
…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 GuideIntroduce an optional asynchronous mode to run_map so callers can get the YT Operation immediately instead of blocking, and add tests and lint configuration to support it. Sequence diagram for run_map synchronous vs asynchronous executionsequenceDiagram
participant Caller
participant run_map
participant yt_client
participant Operation
Caller->>run_map: run_map(context, mapper, job, sync)
run_map->>Operation: [create operation]
alt [sync is False]
run_map-->>Caller: return Operation
else [sync is True]
run_map->>yt_client: wait_for_operation(Operation)
yt_client-->>run_map: success: bool
run_map-->>Caller: return success: bool
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:
- Changing
run_mapto returnbool | Operationbased onsyncmay complicate call sites; consider either splitting into two functions (sync and async) or using a single return type that encapsulates both behaviors to keep usage predictable. - Instead of extending the parameter list and adding a new
PLR0913ignore formap.py, consider refactoringrun_mapto take a configuration object (e.g., a dataclass) to reduce arity and make the function signature easier to manage.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Changing `run_map` to return `bool | Operation` based on `sync` may complicate call sites; consider either splitting into two functions (sync and async) or using a single return type that encapsulates both behaviors to keep usage predictable.
- Instead of extending the parameter list and adding a new `PLR0913` ignore for `map.py`, consider refactoring `run_map` to take a configuration object (e.g., a dataclass) to reduce arity and make the function signature easier to manage.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 keeping existing synchronous behavior by default.
New Features:
Enhancements:
Build:
Tests: