Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core] Replaced StopAsyncIteration with a return to prevent errors when no tasks are provided. #991

Merged
merged 7 commits into from
Sep 5, 2024

Conversation

mk-armah
Copy link
Member

@mk-armah mk-armah commented Sep 5, 2024

Description

What:

  • Replaced StopAsyncIteration with a return statement in the stream_async_iterators_tasks function. This ensures nothing is returned when empty tasks are provided to the function.

Why:

  • The use of StopAsyncIteration was causing improper error handling in scenarios where no async tasks were provided. By replacing with a return statement, the error is prevented and nothing is returned just as nothing was provided.

How:

  • Replaced StopAsyncIteration with a return statement return nothing when an empty list of tasks is passed to the stream_async_iterators_tasks function.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

@mk-armah mk-armah requested a review from a team as a code owner September 5, 2024 12:42
Copy link
Member

@matan84 matan84 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment

port_ocean/utils/async_iterators.py Outdated Show resolved Hide resolved
@mk-armah mk-armah changed the title [Core] Replaced StopAsyncIteration with a custom error to properly propagate errors. [Core] Replaced StopAsyncIteration with a return to prevent errors when no tasks are provided. Sep 5, 2024
Copy link
Member

@matan84 matan84 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@matan84 matan84 merged commit 71bedda into main Sep 5, 2024
12 checks passed
@matan84 matan84 deleted the bug/ocean branch September 5, 2024 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants