handlers_3.py 760 B

1234567891011121314151617181920
  1. def put_data_mapper_handler(event, context):
  2. path_params = event["pathParameters"]
  3. body = event["body"]
  4. validate_mapper(body)
  5. item = {
  6. "DataMapperId": path_params["data_mapper_id"],
  7. "Columns": body["Columns"],
  8. "QueryExecutor": body["QueryExecutor"],
  9. "QueryExecutorParameters": body["QueryExecutorParameters"],
  10. "CreatedBy": get_user_info(event),
  11. "RoleArn": body["RoleArn"],
  12. "Format": body.get("Format", "parquet"),
  13. "DeleteOldVersions": body.get("DeleteOldVersions", True),
  14. "IgnoreObjectNotFoundExceptions": body.get(
  15. "IgnoreObjectNotFoundExceptions", False
  16. ),
  17. }
  18. table.put_item(Item=item)
  19. return {"statusCode": 201, "body": json.dumps(item)}