Skip to content

use "begin" instead error when trying to execute async method in Python #3012

@zhzhang

Description

@zhzhang

❓ Guidance

Affected Languages

  • TypeScript or Javascript
  • [X ] Python
  • Java
  • .NET (C#, F#, ...)
  • Go

General Information

  • JSII Version: 1.34.0
  • Platform: OSX

The Question

I have an async class method defined like

export class ProjectResources {
    ...
  public static async createProjectResources(
    props: ProjectResourcesProps
  ): Promise<ProjectResources> {
    // Some more async calls here.
  }
}

That is producing jsii.errors.JSIIError: createProjectResources is an async method, use "begin" instead when it is executed in python.
Is there any way I should be defining or using async methods in python differently?

The TS code compiles to Python and packages without any errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    guidanceQuestion that needs advice or information.needs-triageThis issue or PR still needs to be triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions