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

[sdk/gen] Avoid generating Result types for functions with empty outputs #11596

Merged

Conversation

Zaid-Ajaj
Copy link
Contributor

Description

Part of #11418 where we shouldn't generate result types for function invokes that have no properties.

This is a separate PR to showcase the exact changes required to improve the situation and reduce the diff from #11418

Checklist

  • I have added tests that prove my fix is effective or that my feature works
  • I have run make changelog and committed the changelog/pending/<file> documenting my change
  • Yes, there are changes in this PR that warrants bumping the Pulumi Service API version

@Zaid-Ajaj Zaid-Ajaj requested a review from iwahbe December 8, 2022 17:05
@pulumi-bot
Copy link
Contributor

pulumi-bot commented Dec 8, 2022

Changelog

[uncommitted] (2022-12-09)

Bug Fixes

  • [sdkgen/{dotnet,go,nodejs,python}] Do not generate Result types for functions with empty outputs
    #11596

@iwahbe iwahbe self-requested a review December 9, 2022 10:54
Copy link
Member

@iwahbe iwahbe left a comment

Choose a reason for hiding this comment

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

Except for #11596 (comment), my questions have been answered. LGTM!

@Zaid-Ajaj Zaid-Ajaj force-pushed the zaid/avoid-generating-empty-result-types-for-functions branch from 98068fb to b0b4add Compare December 9, 2022 13:36
Copy link
Member

@iwahbe iwahbe left a comment

Choose a reason for hiding this comment

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

I think this is good to merge.

from . import _utilities

__all__ = [
'func_with_const_input',
]

def func_with_const_input(plain_input: Optional[str] = None,
opts: Optional[pulumi.InvokeOptions] = None):
opts: Optional[pulumi.InvokeOptions] = None) -> Awaitable[None]:
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't return anything, so I guess None coerces to Awaitable[None].

@Zaid-Ajaj
Copy link
Contributor Author

bors merge

@bors
Copy link
Contributor

bors bot commented Dec 9, 2022

Build succeeded:

@bors bors bot merged commit c11a8eb into master Dec 9, 2022
@bors bors bot deleted the zaid/avoid-generating-empty-result-types-for-functions branch December 9, 2022 16:44
abhinav added a commit to pulumi/pulumi-java that referenced this pull request Feb 13, 2023
Void results don't get Result types anymore (pulumi/pulumi#11596)
abhinav pushed a commit to pulumi/pulumi-java that referenced this pull request Feb 13, 2023
Bumps [github.com/pulumi/pulumi/pkg/v3](https://github.com/pulumi/pulumi) from 3.49.0 to 3.54.0.

To account for changes since 3.49:

- Skips two more codegen tests. These were added recently (pulumi/pulumi#11996 and pulumi/pulumi#11893) and the Java SDK does not pass these yet.
- Update generated code—a function without a result doesn't get a Result type anymore (pulumi/pulumi#11596).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants