2022/08/02 - Amazon Personalize - 3 updated api methods
Changes This release adds support for incremental bulk ingestion for the Personalize CreateDatasetImportJob API.
{'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' )
string
[REQUIRED]
The name for the dataset import job.
string
[REQUIRED]
The ARN of the dataset that receives the imported data.
dict
[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/
string
[REQUIRED]
The ARN of the IAM role that has permissions to read from the Amazon S3 data source.
list
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).
string
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.
dict
Response Syntax
{ 'datasetImportJobArn': 'string' }
Response Structure
(dict) --
datasetImportJobArn (string) --
The ARN of the dataset import job.
{'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' )
string
[REQUIRED]
The Amazon Resource Name (ARN) of the dataset import job to describe.
dict
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.
{'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 )
string
The Amazon Resource Name (ARN) of the dataset to list the dataset import jobs for.
string
A token returned from the previous call to ListDatasetImportJobs for getting the next set of dataset import jobs (if they exist).
integer
The maximum number of dataset import jobs to return.
dict
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).