Skip to content

Fix typing on FunctionCall.gather #3062

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

Merged
merged 1 commit into from
Apr 28, 2025

Conversation

mwaskom
Copy link
Contributor

@mwaskom mwaskom commented Apr 25, 2025

Describe your changes

We made modal.functions.gather generic in #2188 but I neglected to migrate this properly when introducing modal.FunctionCall.gather. Simple fix.

Fixes #3020

@mwaskom mwaskom force-pushed the michael/2025-04-25-fix-function-call-gather-typing branch from 4356f21 to 792ee3d Compare April 25, 2025 19:55
@mwaskom mwaskom force-pushed the michael/2025-04-25-fix-function-call-gather-typing branch from 792ee3d to 63e90f8 Compare April 25, 2025 20:27
@@ -1667,7 +1668,7 @@ async def from_id(
return fc

@staticmethod
async def gather(*function_calls: "_FunctionCall[Any]") -> list[Any]:
async def gather(*function_calls: "_FunctionCall[T]") -> typing.Sequence[T]:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Couldn't use ReturnType here since this is a staticmethod.

@mwaskom mwaskom requested a review from freider April 28, 2025 12:29
@mwaskom
Copy link
Contributor Author

mwaskom commented Apr 28, 2025

@prbot approve

Copy link

@modal-pr-review-automation modal-pr-review-automation bot left a comment

Choose a reason for hiding this comment

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

Approved 👍. @freider will follow-up review this.

@mwaskom mwaskom merged commit 7a51123 into main Apr 28, 2025
26 checks passed
@mwaskom mwaskom deleted the michael/2025-04-25-fix-function-call-gather-typing branch April 28, 2025 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

modal.FunctionCall.gather generics not working properly
1 participant