boto / boto3

AWS SDK for Python
https://aws.amazon.com/sdk-for-python/
Apache License 2.0
8.87k stars 1.85k forks source link

metadataColumns not acceptable parameter for user-personalization-v2 campaign #4189

Closed pranavchaturved closed 3 weeks ago

pranavchaturved commented 3 weeks ago

Describe the bug

metadataColumns not acceptable parameter for user-personalization-v2 campaign

Expected Behavior

Should return results with associated metadata columns.

Current Behavior

Throws error.

ParamValidationError: Parameter validation failed: Unknown parameter in input: "metadataColumns", must be one of: campaignArn, itemId, userId, numResults, context, filterArn, filterValues, recommenderArn, promotions

Reproduction Steps

import boto3

personalizeRt = boto3.client('personalize-runtime')

response = personalizeRt.get_recommendations(
  campaignArn = 'Campaign ARN',
  userId = 'User ID',
  numResults = 10
  metadataColumns = {
    "ITEMS": ['columnNameA','columnNameB']
  }
)

print("Recommended items")
for item in response['itemList']:
  print(item['itemId'])
  print(item['metadata'])

Above example doesn't work as it says: ParamValidationError: Parameter validation failed: Unknown parameter in input: "metadataColumns", must be one of: campaignArn, itemId, userId, numResults, context, filterArn, filterValues, recommenderArn, promotions

Possible Solution

No response

Additional Information/Context

No response

SDK version used

Name: boto3 Version: 1.28.78 Summary: The AWS SDK for Python

Environment details (OS name and version, etc.)

mac m1, ventura 13.0

tim-finnigan commented 3 weeks ago

Hi @pranavchaturved, it looks like this was added in version 1.29.7. The latest version of Boto3 is 1.34.139 per the CHANGELOG. Please update your version of Boto3 in order to access the latest supported parameters for commands like get_recommendations.

github-actions[bot] commented 3 weeks ago

This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.