Amazon Personalize

2022/08/02 - Amazon Personalize - 3 updated api methods

Changes  This release adds support for incremental bulk ingestion for the Personalize CreateDatasetImportJob API.

CreateDatasetImportJob (updated) Link ¶
Changes (request)
{'importMode': 'FULL | INCREMENTAL'}

Creates a job that imports training data from your data source (an Amazon S3 bucket) to an Amazon Personalize dataset. To allow Amazon Personalize to import the training data, you must specify an IAM service role that has permission to read from the data source, as Amazon Personalize makes a copy of your data and processes it internally. For information on granting access to your Amazon S3 bucket, see Giving Amazon Personalize Access to Amazon S3 Resources.

Warning

By default, a dataset import job replaces any existing data in the dataset that you imported in bulk. To add new records without replacing existing data, specify INCREMENTAL for the import mode in the CreateDatasetImportJob operation.

Status

A dataset import job can be in one of the following states:

  • CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED

To get the status of the import job, call DescribeDatasetImportJob, providing the Amazon Resource Name (ARN) of the dataset import job. The dataset import is complete when the status shows as ACTIVE. If the status shows as CREATE FAILED, the response includes a failureReason key, which describes why the job failed.

Note

Importing takes time. You must wait until the status shows as ACTIVE before training a model using the dataset.

Related APIs

See also: AWS API Documentation

Request Syntax

client.create_dataset_import_job(
    jobName='string',
    datasetArn='string',
    dataSource={
        'dataLocation': 'string'
    },
    roleArn='string',
    tags=[
        {
            'tagKey': 'string',
            'tagValue': 'string'
        },
    ],
    importMode='FULL'|'INCREMENTAL'
)
type jobName

string

param jobName

[REQUIRED]

The name for the dataset import job.

type datasetArn

string

param datasetArn

[REQUIRED]

The ARN of the dataset that receives the imported data.

type dataSource

dict

param dataSource

[REQUIRED]

The Amazon S3 bucket that contains the training data to import.

  • dataLocation (string) --

    The path to the Amazon S3 bucket where the data that you want to upload to your dataset is stored. For example:

    s3://bucket-name/folder-name/

type roleArn

string

param roleArn

[REQUIRED]

The ARN of the IAM role that has permissions to read from the Amazon S3 data source.

type tags

list

param tags

A list of tags to apply to the dataset import job.

  • (dict) --

    The optional metadata that you apply to resources to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. For more information see Tagging Personalize resources.

    • tagKey (string) -- [REQUIRED]

      One part of a key-value pair that makes up a tag. A key is a general label that acts like a category for more specific tag values.

    • tagValue (string) -- [REQUIRED]

      The optional part of a key-value pair that makes up a tag. A value acts as a descriptor within a tag category (key).

type importMode

string

param importMode

Specify how to add the new records to an existing dataset. The default import mode is FULL . If you haven't imported bulk records into the dataset previously, you can only specify FULL .

  • Specify FULL to overwrite all existing bulk data in your dataset. Data you imported individually is not replaced.

  • Specify INCREMENTAL to append the new records to the existing data in your dataset. Amazon Personalize replaces any record with the same ID with the new one.

rtype

dict

returns

Response Syntax

{
    'datasetImportJobArn': 'string'
}

Response Structure

  • (dict) --

    • datasetImportJobArn (string) --

      The ARN of the dataset import job.

DescribeDatasetImportJob (updated) Link ¶
Changes (response)
{'datasetImportJob': {'importMode': 'FULL | INCREMENTAL'}}

Describes the dataset import job created by CreateDatasetImportJob, including the import job status.

See also: AWS API Documentation

Request Syntax

client.describe_dataset_import_job(
    datasetImportJobArn='string'
)
type datasetImportJobArn

string

param datasetImportJobArn

[REQUIRED]

The Amazon Resource Name (ARN) of the dataset import job to describe.

rtype

dict

returns

Response Syntax

{
    'datasetImportJob': {
        'jobName': 'string',
        'datasetImportJobArn': 'string',
        'datasetArn': 'string',
        'dataSource': {
            'dataLocation': 'string'
        },
        'roleArn': 'string',
        'status': 'string',
        'creationDateTime': datetime(2015, 1, 1),
        'lastUpdatedDateTime': datetime(2015, 1, 1),
        'failureReason': 'string',
        'importMode': 'FULL'|'INCREMENTAL'
    }
}

Response Structure

  • (dict) --

    • datasetImportJob (dict) --

      Information about the dataset import job, including the status.

      The status is one of the following values:

      • CREATE PENDING

      • CREATE IN_PROGRESS

      • ACTIVE

      • CREATE FAILED

      • jobName (string) --

        The name of the import job.

      • datasetImportJobArn (string) --

        The ARN of the dataset import job.

      • datasetArn (string) --

        The Amazon Resource Name (ARN) of the dataset that receives the imported data.

      • dataSource (dict) --

        The Amazon S3 bucket that contains the training data to import.

        • dataLocation (string) --

          The path to the Amazon S3 bucket where the data that you want to upload to your dataset is stored. For example:

          s3://bucket-name/folder-name/

      • roleArn (string) --

        The ARN of the IAM role that has permissions to read from the Amazon S3 data source.

      • status (string) --

        The status of the dataset import job.

        A dataset import job can be in one of the following states:

        • CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED

      • creationDateTime (datetime) --

        The creation date and time (in Unix time) of the dataset import job.

      • lastUpdatedDateTime (datetime) --

        The date and time (in Unix time) the dataset was last updated.

      • failureReason (string) --

        If a dataset import job fails, provides the reason why.

      • importMode (string) --

        The import mode used by the dataset import job to import new records.

ListDatasetImportJobs (updated) Link ¶
Changes (response)
{'datasetImportJobs': {'importMode': 'FULL | INCREMENTAL'}}

Returns a list of dataset import jobs that use the given dataset. When a dataset is not specified, all the dataset import jobs associated with the account are listed. The response provides the properties for each dataset import job, including the Amazon Resource Name (ARN). For more information on dataset import jobs, see CreateDatasetImportJob. For more information on datasets, see CreateDataset.

See also: AWS API Documentation

Request Syntax

client.list_dataset_import_jobs(
    datasetArn='string',
    nextToken='string',
    maxResults=123
)
type datasetArn

string

param datasetArn

The Amazon Resource Name (ARN) of the dataset to list the dataset import jobs for.

type nextToken

string

param nextToken

A token returned from the previous call to ListDatasetImportJobs for getting the next set of dataset import jobs (if they exist).

type maxResults

integer

param maxResults

The maximum number of dataset import jobs to return.

rtype

dict

returns

Response Syntax

{
    'datasetImportJobs': [
        {
            'datasetImportJobArn': 'string',
            'jobName': 'string',
            'status': 'string',
            'creationDateTime': datetime(2015, 1, 1),
            'lastUpdatedDateTime': datetime(2015, 1, 1),
            'failureReason': 'string',
            'importMode': 'FULL'|'INCREMENTAL'
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • datasetImportJobs (list) --

      The list of dataset import jobs.

      • (dict) --

        Provides a summary of the properties of a dataset import job. For a complete listing, call the DescribeDatasetImportJob API.

        • datasetImportJobArn (string) --

          The Amazon Resource Name (ARN) of the dataset import job.

        • jobName (string) --

          The name of the dataset import job.

        • status (string) --

          The status of the dataset import job.

          A dataset import job can be in one of the following states:

          • CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED

        • creationDateTime (datetime) --

          The date and time (in Unix time) that the dataset import job was created.

        • lastUpdatedDateTime (datetime) --

          The date and time (in Unix time) that the dataset import job status was last updated.

        • failureReason (string) --

          If a dataset import job fails, the reason behind the failure.

        • importMode (string) --

          The import mode the dataset import job used to update the data in the dataset. For more information see Updating existing bulk data.

    • nextToken (string) --

      A token for getting the next set of dataset import jobs (if they exist).