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

FIX: Accept Iterable of Mappings from async step functions in functional API #25

Merged
merged 7 commits into from
Jul 9, 2024

Conversation

j-ittner
Copy link
Member

@j-ittner j-ittner commented Jul 9, 2024

This Pull Request introduces an enhancement to the Fluxus library's functional API, specifically targeting the step function and related classes within the conduit module. The changes expand the range of acceptable return types for functions passed to step, allowing for greater flexibility in asynchronous programming patterns.

Key Changes:

  1. Expanded Awaitable Return Types:

    • The return type annotations for the step function and the Step class have been extended to include Awaitable[Iterable[Mapping[str, Any]]] and Awaitable[AsyncIterable[Mapping[str, Any]]]. This allows asynchronious functions passed to step to return not just single mappings/dictionaries but also iterables or async iterables of mappings/dictionaries.
  2. Handling Awaitable Iterables:

    • Modifications in Step class implementation to properly handle and unwrap the new awaitable iterable return types. This ensures that the library can asynchronously process iterables of mappings/dictionaries.

Closes #24.

@j-ittner j-ittner added the bug Something isn't working label Jul 9, 2024
@j-ittner j-ittner added this to the 1.0.2 milestone Jul 9, 2024
@j-ittner j-ittner requested a review from AlexanderLontke July 9, 2024 07:50
@j-ittner j-ittner self-assigned this Jul 9, 2024
Copy link
Contributor

@AlexanderLontke AlexanderLontke left a comment

Choose a reason for hiding this comment

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

Changes work as desired!

@j-ittner j-ittner merged commit b388ace into 1.0.x Jul 9, 2024
14 checks passed
@j-ittner j-ittner deleted the fix/step-returning-iter-from-coroutine branch July 9, 2024 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Error when returning an Iterable of Mappings in an asynchronous step
2 participants