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

Emit correct type stubs for async functions wrapped with additional decorators #194

Merged
merged 4 commits into from
Dec 17, 2024

Conversation

mwaskom
Copy link
Contributor

@mwaskom mwaskom commented Dec 10, 2024

Basically stumbled around in the dark until I got this working, so I'm not sure it's correct or ideal. But it gets my test case and actual usecase working AFAICT.

@mwaskom mwaskom requested a review from freider December 10, 2024 20:52
@mwaskom mwaskom force-pushed the michael/2024-12-10-support-wrapped-functions branch from f9b01a7 to 076ba13 Compare December 10, 2024 20:58
@mwaskom mwaskom requested a review from freider December 12, 2024 14:49
@@ -38,6 +38,15 @@ async def wrapper(*args, **kwargs):
return functools.wraps(func)


def is_coroutine_function_follow_wrapped(func: typing.Callable) -> bool:
"""Determine if a function returns a coroutine, unwrapping decorators, but not the async synchronicitiy interace."""
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Typo in docstring: synchronicitiy

@mwaskom mwaskom force-pushed the michael/2024-12-10-support-wrapped-functions branch from b06bfa8 to a1f7e00 Compare December 16, 2024 17:09
@mwaskom mwaskom force-pushed the michael/2024-12-10-support-wrapped-functions branch from 57df19c to 8b4b763 Compare December 16, 2024 17:22
@mwaskom
Copy link
Contributor Author

mwaskom commented Dec 17, 2024

@prbot approve

@modal-pr-review-automation
Copy link

Please request a reviewer to follow up with a post-merge review.

@mwaskom mwaskom requested a review from freider December 17, 2024 13:38
@mwaskom
Copy link
Contributor Author

mwaskom commented Dec 17, 2024

@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 42f549b into main Dec 17, 2024
10 checks passed
@mwaskom mwaskom deleted the michael/2024-12-10-support-wrapped-functions branch December 17, 2024 14:24
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.

2 participants