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

Update operator asyc execution check #3512

Closed
wants to merge 1 commit into from

Conversation

kaixi-wang
Copy link
Contributor

Make the check for any awaitable, not just asyncio.iscoroutinefunction which might have some issues/will be depreciated: python/cpython#94912

@kaixi-wang kaixi-wang requested a review from ritch September 12, 2023 17:11
@kaixi-wang kaixi-wang self-assigned this Sep 12, 2023
@@ -199,7 +200,7 @@ async def execute_or_delegate_operator(operator_uri, request_params):
try:
raw_result = await (
operator.execute(ctx)
if asyncio.iscoroutinefunction(operator.execute)
if inspect.isawaitable(operator.execute)
Copy link
Contributor

Choose a reason for hiding this comment

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

This will always return false. These are not functionally equivelent.

Copy link
Contributor

Choose a reason for hiding this comment

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

image

@@ -199,7 +200,7 @@ async def execute_or_delegate_operator(operator_uri, request_params):
try:
raw_result = await (
operator.execute(ctx)
if asyncio.iscoroutinefunction(operator.execute)
if inspect.isawaitable(operator.execute)
Copy link
Contributor

Choose a reason for hiding this comment

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

image

@ritch ritch closed this Sep 14, 2023
@ritch ritch deleted the kacey/debug-operators-await branch September 14, 2023 16:21
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