Home > OS >  AssertionError: Unexpected type. Expected 'list' got '<class 'str'>&#
AssertionError: Unexpected type. Expected 'list' got '<class 'str'>&#

Time:09-25

I want to create Azure Databricks with Pulumi from this document.

My code is :

databricks_workspace = azure_native.databricks.Workspace('databrick',
                                                         location=location_name,
                                                         resource_group_name=resource_group.name,
                                                         managed_resource_group_id=pulumi.Output.all(
                                                             resource_group.id),
                                                         workspace_name='workspace-{}-{}'.format(
                                                             project_name, stack_name),
                                                         sku=azure_native.databricks.SkuArgs(
                                                             name='Standard',
                                                             tier='Standard'
                                                         ),
                                                         tags={
                                                             'Team': 'Data',
                                                             'Environment': stack_name,
                                                         },
                                                         )

The input of managed_resource_group_id is the output of resource_group. When I run this code I received this error:

raise AssertionError(f"Unexpected type. Expected 'list' got '{typ}'")
AssertionError: Unexpected type. Expected 'list' got '<class 'str'>'
error: an unhandled error occurred: Program exited with non-zero exit code: 1

CodePudding user response:

The only problem I see without running your code is that managed_resource_group_id should be a string but you pass a result of pulumi.Output.all to it. Could you try changing to

managed_resource_group_id=resource_group.id,
  • Related