简体   繁体   English

将 object 放入 S3 存储桶时出错

[英]Errors while putting object on S3 bucket

I am trying to get temperature value from DynamoDB table and calculating the average of that values and sending average value to S3 bucket.我正在尝试从 DynamoDB 表中获取温度值并计算该值的平均值并将平均值发送到 S3 存储桶。 I calculated the Average value but when putting that value to s3 bucket I got the error:我计算了平均值,但是将该值放入 s3 存储桶时出现错误:

Response:回复:

{
  "errorMessage": "Syntax error in module 'lambda_function': positional argument follows keyword argument (lambda_function.py, line 45)",
  "errorType": "Runtime.UserCodeSyntaxError",
  "stackTrace": [
    "  File \"/var/task/lambda_function.py\" Line 45\n        s3.put_object(Bucket='mys3pooja', Key='time', Body=val)\n"
  ]
}

Error you're shown is syntax related.显示的错误与语法相关。

If you have function or method with signature like def foo(bar, foo="something") , it has positional argument bar and keyword argument foo .如果你有 function 或带有像def foo(bar, foo="something")这样的签名的方法,它有位置参数bar和关键字参数foo Python's convention is to always put positional arguments before keyword ones when you call this function, so result = foo(1, foo="text") is correct, but result = foo(foo="text", 1) is incorrect Python 的约定是在调用这个 function 时始终将位置 arguments 放在关键字之前,因此result = foo(1, foo="text")是正确的,但result = foo(foo="text", 1)是不正确的

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM