Skip to content

create_data_set async

create_data_set(
    aws_account_id: AwsAccountId,
    data_set_id: ResourceId,
    name: ResourceName,
    physical_table_map: PhysicalTableMap,
    import_mode: DataSetImportMode,
    *,
    config_overrides: Optional[AsyncQuickSightClientConfig] = None,
    logical_table_map: Optional[LogicalTableMap] = None,
    column_groups: Optional[ColumnGroupList] = None,
    field_folders: Optional[FieldFolderMap] = None,
    permissions: Optional[ResourcePermissionList] = None,
    row_level_permission_data_set: Optional[RowLevelPermissionDataSet] = None,
    row_level_permission_tag_configuration: Optional[
        RowLevelPermissionTagConfiguration
    ] = None,
    column_level_permission_rules: Optional[ColumnLevelPermissionRuleList] = None,
    tags: Optional[TagList] = None,
    data_set_usage_configuration: Optional[DataSetUsageConfiguration] = None,
    dataset_parameters: Optional[DatasetParameterList] = None,
    folder_arns: Optional[FolderArnList] = None,
    performance_configuration: Optional[PerformanceConfiguration] = None,
    use_as: Optional[DataSetUseAs] = None,
    data_prep_configuration: Optional[DataPrepConfiguration] = None,
    semantic_model_configuration: Optional[SemanticModelConfiguration] = None,
) -> CreateDataSetResponse

Creates a dataset.

Parameters:

  • aws_account_id (AwsAccountId) –

    The Amazon Web Services account ID.

  • data_set_id (ResourceId) –

    An ID for the dataset that you want to create. This ID is unique per Amazon Web Services Region for each Amazon Web Services account.

  • name (ResourceName) –

    The display name for the dataset.

  • physical_table_map (PhysicalTableMap) –

    Declares the physical tables that are available in the underlying data sources.

  • logical_table_map (Optional[LogicalTableMap], default: None ) –

    Configures the combination and transformation of the data from the physical tables. This parameter is used with the legacy data preparation experience.

  • import_mode (DataSetImportMode) –

    Indicates whether you want to import the data into SPICE.

  • column_groups (Optional[ColumnGroupList], default: None ) –

    Groupings of columns that work together in certain Amazon Quick Sight features. Currently, only geospatial hierarchy is supported.

  • field_folders (Optional[FieldFolderMap], default: None ) –

    The folder that contains fields and nested subfolders for your dataset.

  • permissions (Optional[ResourcePermissionList], default: None ) –

    A list of resource permissions on the dataset.

  • row_level_permission_data_set (Optional[RowLevelPermissionDataSet], default: None ) –

    The row-level security configuration for the data that you want to create. This parameter is used with the legacy data preparation experience.

  • row_level_permission_tag_configuration (Optional[RowLevelPermissionTagConfiguration], default: None ) –

    The configuration of tags on a dataset to set row-level security. Row-level security tags are currently supported for anonymous embedding only. This parameter is used with the legacy data preparation experience.

  • column_level_permission_rules (Optional[ColumnLevelPermissionRuleList], default: None ) –

    A set of one or more definitions of a ColumnLevelPermissionRule .

  • tags (Optional[TagList], default: None ) –

    Contains a map of the key-value pairs for the resource tag or tags assigned to the dataset.

  • dataset_parameters (Optional[DatasetParameterList], default: None ) –

    The parameter declarations of the dataset.

  • folder_arns (Optional[FolderArnList], default: None ) –

    When you create the dataset, Amazon Quick Sight adds the dataset to these folders.

  • performance_configuration (Optional[PerformanceConfiguration], default: None ) –

    The configuration for the performance optimization of the dataset that contains a UniqueKey configuration.

  • use_as (Optional[DataSetUseAs], default: None ) –

    The usage of the dataset. RLS_RULES must be specified for RLS permission datasets.

  • data_prep_configuration (Optional[DataPrepConfiguration], default: None ) –

    The data preparation configuration for the dataset. This configuration defines the source tables, transformation steps, and destination tables used to prepare the data. Required when using the new data preparation experience.

  • semantic_model_configuration (Optional[SemanticModelConfiguration], default: None ) –

    The semantic model configuration for the dataset. This configuration defines how the prepared data is structured for an analysis, including table mappings and row-level security configurations. Required when using the new data preparation experience.

Raises:

  • AccessDeniedException –

    You don't have access to this item. The provided credentials couldn't be validated. You might not be authorized to carry out the request. Make sure that your account is authorized to use the Amazon Quick Sight service, that your policies have the correct permissions, and that you are using the correct credentials.

  • ConflictException –

    Updating or deleting a resource can cause an inconsistent state.

  • InternalFailureException –

    An internal failure occurred.

  • InvalidDataSetParameterValueException –

    An exception thrown when an invalid parameter value is provided for dataset operations.

  • InvalidParameterValueException –

    One or more parameters has a value that isn't valid.

  • LimitExceededException –

    A limit is exceeded.

  • ResourceExistsException –

    The resource specified already exists.

  • ResourceNotFoundException –

    One or more resources can't be found.

  • ThrottlingException –

    Access is throttled.

  • UnsupportedUserEditionException –

    This error indicates that you are calling an operation on an Amazon Quick Suite subscription where the edition doesn't include support for that operation. Amazon Quick Suite currently has Standard Edition and Enterprise Edition. Not every operation and capability is available in every edition.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_quicksight/_services/async_quick_sight.py
async def create_data_set(
    self,
    aws_account_id: "capo_quicksight.types.aws_account_id.AwsAccountId",
    data_set_id: "capo_quicksight.types.resource_id.ResourceId",
    name: "capo_quicksight.types.resource_name.ResourceName",
    physical_table_map: "capo_quicksight.types.physical_table_map.PhysicalTableMap",
    import_mode: "capo_quicksight.types.data_set_import_mode.DataSetImportMode",
    *,
    config_overrides: Optional[AsyncQuickSightClientConfig] = None,
    logical_table_map: Optional[
        "capo_quicksight.types.logical_table_map.LogicalTableMap"
    ] = None,
    column_groups: Optional[
        "capo_quicksight.types.column_group_list.ColumnGroupList"
    ] = None,
    field_folders: Optional[
        "capo_quicksight.types.field_folder_map.FieldFolderMap"
    ] = None,
    permissions: Optional[
        "capo_quicksight.types.resource_permission_list.ResourcePermissionList"
    ] = None,
    row_level_permission_data_set: Optional[
        "capo_quicksight.types.row_level_permission_data_set.RowLevelPermissionDataSet"
    ] = None,
    row_level_permission_tag_configuration: Optional[
        "capo_quicksight.types.row_level_permission_tag_configuration.RowLevelPermissionTagConfiguration"
    ] = None,
    column_level_permission_rules: Optional[
        "capo_quicksight.types.column_level_permission_rule_list.ColumnLevelPermissionRuleList"
    ] = None,
    tags: Optional["capo_quicksight.types.tag_list.TagList"] = None,
    data_set_usage_configuration: Optional[
        "capo_quicksight.types.data_set_usage_configuration.DataSetUsageConfiguration"
    ] = None,
    dataset_parameters: Optional[
        "capo_quicksight.types.dataset_parameter_list.DatasetParameterList"
    ] = None,
    folder_arns: Optional[
        "capo_quicksight.types.folder_arn_list.FolderArnList"
    ] = None,
    performance_configuration: Optional[
        "capo_quicksight.types.performance_configuration.PerformanceConfiguration"
    ] = None,
    use_as: Optional["capo_quicksight.types.data_set_use_as.DataSetUseAs"] = None,
    data_prep_configuration: Optional[
        "capo_quicksight.types.data_prep_configuration.DataPrepConfiguration"
    ] = None,
    semantic_model_configuration: Optional[
        "capo_quicksight.types.semantic_model_configuration.SemanticModelConfiguration"
    ] = None,
) -> "capo_quicksight.types.create_data_set_response.CreateDataSetResponse":
    """<p>Creates a dataset.</p>

    Args:
        aws_account_id: <p>The Amazon Web Services account ID.</p>
        data_set_id: <p>An ID for the dataset that you want to create. This ID is unique per Amazon Web Services Region for each Amazon Web Services account.</p>
        name: <p>The display name for the dataset.</p>
        physical_table_map: <p>Declares the physical tables that are available in the underlying data sources.</p>
        logical_table_map: <p>Configures the combination and transformation of the data from the physical tables. This parameter is used with the legacy data preparation experience.</p>
        import_mode: <p>Indicates whether you want to import the data into SPICE.</p>
        column_groups: <p>Groupings of columns that work together in certain Amazon Quick Sight features. Currently, only geospatial hierarchy is supported.</p>
        field_folders: <p>The folder that contains fields and nested subfolders for your dataset.</p>
        permissions: <p>A list of resource permissions on the dataset.</p>
        row_level_permission_data_set: <p>The row-level security configuration for the data that you want to create. This parameter is used with the legacy data preparation experience.</p>
        row_level_permission_tag_configuration: <p>The configuration of tags on a dataset to set row-level security. Row-level security tags are currently supported for anonymous embedding only. This parameter is used with the legacy data preparation experience.</p>
        column_level_permission_rules: <p>A set of one or more definitions of a <code> <a href="https://docs.aws.amazon.com/quicksight/latest/APIReference/API_ColumnLevelPermissionRule.html">ColumnLevelPermissionRule</a> </code>.</p>
        tags: <p>Contains a map of the key-value pairs for the resource tag or tags assigned to the dataset.</p>
        dataset_parameters: <p>The parameter declarations of the dataset.</p>
        folder_arns: <p>When you create the dataset, Amazon Quick Sight adds the dataset to these folders.</p>
        performance_configuration: <p>The configuration for the performance optimization of the dataset that contains a <code>UniqueKey</code> configuration.</p>
        use_as: <p>The usage of the dataset. <code>RLS_RULES</code> must be specified for RLS permission datasets.</p>
        data_prep_configuration: <p>The data preparation configuration for the dataset. This configuration defines the source tables, transformation steps, and destination tables used to prepare the data. Required when using the new data preparation experience.</p>
        semantic_model_configuration: <p>The semantic model configuration for the dataset. This configuration defines how the prepared data is structured for an analysis, including table mappings and row-level security configurations. Required when using the new data preparation experience.</p>

    Raises:
        capo_quicksight.errors.access_denied_exception.AccessDeniedException: <p>You don't have access to this item. The provided credentials couldn't be validated. You might not be authorized to carry out the request. Make sure that your account is authorized to use the Amazon Quick Sight service, that your policies have the correct permissions, and that you are using the correct credentials.</p>
        capo_quicksight.errors.conflict_exception.ConflictException: <p>Updating or deleting a resource can cause an inconsistent state.</p>
        capo_quicksight.errors.internal_failure_exception.InternalFailureException: <p>An internal failure occurred.</p>
        capo_quicksight.errors.invalid_data_set_parameter_value_exception.InvalidDataSetParameterValueException: <p>An exception thrown when an invalid parameter value is provided for dataset operations.</p>
        capo_quicksight.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>One or more parameters has a value that isn't valid.</p>
        capo_quicksight.errors.limit_exceeded_exception.LimitExceededException: <p>A limit is exceeded.</p>
        capo_quicksight.errors.resource_exists_exception.ResourceExistsException: <p>The resource specified already exists. </p>
        capo_quicksight.errors.resource_not_found_exception.ResourceNotFoundException: <p>One or more resources can't be found.</p>
        capo_quicksight.errors.throttling_exception.ThrottlingException: <p>Access is throttled.</p>
        capo_quicksight.errors.unsupported_user_edition_exception.UnsupportedUserEditionException: <p>This error indicates that you are calling an operation on an Amazon Quick Suite subscription where the edition doesn't include support for that operation. Amazon Quick Suite currently has Standard Edition and Enterprise Edition. Not every operation and capability is available in every edition.</p>
        capo_quicksight.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_quicksight.types.create_data_set_request.CreateDataSetRequest]",
    ) -> AsyncOperationResponse[
        "capo_quicksight.types.create_data_set_response.CreateDataSetResponse"
    ]:
        import capo_quicksight._operations.quick_sight_20180401.create_data_set

        (
            output,
            http_response,
        ) = await capo_quicksight._operations.quick_sight_20180401.create_data_set.async_create_data_set(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_quicksight.types.create_data_set_request.CreateDataSetRequest",
    ) -> dict[str, Any]:
        import capo_quicksight.types.create_data_set_request

        return capo_quicksight.types.create_data_set_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateDataSet", redact_input=_redact_input),
    )
    input_: capo_quicksight.types.create_data_set_request.CreateDataSetRequest = {
        "aws_account_id": aws_account_id,
        "data_set_id": data_set_id,
        "name": name,
        "physical_table_map": physical_table_map,
        "import_mode": import_mode,
    }
    if logical_table_map is not None:
        input_["logical_table_map"] = logical_table_map
    if column_groups is not None:
        input_["column_groups"] = column_groups
    if field_folders is not None:
        input_["field_folders"] = field_folders
    if permissions is not None:
        input_["permissions"] = permissions
    if row_level_permission_data_set is not None:
        input_["row_level_permission_data_set"] = row_level_permission_data_set
    if row_level_permission_tag_configuration is not None:
        input_["row_level_permission_tag_configuration"] = (
            row_level_permission_tag_configuration
        )
    if column_level_permission_rules is not None:
        input_["column_level_permission_rules"] = column_level_permission_rules
    if tags is not None:
        input_["tags"] = tags
    if data_set_usage_configuration is not None:
        input_["data_set_usage_configuration"] = data_set_usage_configuration
    if dataset_parameters is not None:
        input_["dataset_parameters"] = dataset_parameters
    if folder_arns is not None:
        input_["folder_arns"] = folder_arns
    if performance_configuration is not None:
        input_["performance_configuration"] = performance_configuration
    if use_as is not None:
        input_["use_as"] = use_as
    if data_prep_configuration is not None:
        input_["data_prep_configuration"] = data_prep_configuration
    if semantic_model_configuration is not None:
        input_["semantic_model_configuration"] = semantic_model_configuration

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output