我收到此错误。我正在使用 python 3.7 执行 aws lambda 函数的代码来了解 Quicksight 仪表板版本。提前致谢!
errorMessage:“无法封送响应:日期时间类型的对象不可 JSON 序列化”,
错误类型:“运行时.MarshalError”
代码-
import boto3
import time
import sys
client = boto3.client('quicksight')
def lambda_handler(event, context):
response = client.list_dashboard_versions(AwsAccountId='11111', DashboardId='2222',MaxResults=10)
return response
Run Code Online (Sandbox Code Playgroud) python error-handling amazon-web-services python-3.x aws-lambda
为什么我无法在控制台中创建 AWS Lambda python 打印函数?它显示已成功执行,但在结果中我从未看到我想要的打印文字。
我使用了这段代码,它显示了以下执行结果 -
target = "blue"
prediction = "red"
print(file_name,target,prediction, (lambda: '+' if target==prediction else '-')) ```
**Execution result-**
```Response:
{
"statusCode": 200,
"body": "\"Hello from Lambda!\""
}
Request ID:
"xxxxxxx"
Function logs:
START RequestId: xxxxxx Version: $LATEST
END RequestId: xxxxxx
REPORT RequestId: xxxx Duration: 1.14 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 52 MB
Run Code Online (Sandbox Code Playgroud) architecture analysis python-3.x aws-lambda amazon-quicksight