【发布时间】:2022-10-01 00:07:57
【问题描述】:
我有一个配置字典作为我的 python 脚本的一部分,我将其转换为 lambda 函数,并且很难让其中一个事件在端点 URL 中正常工作。
config = dict(
scope = [\"Mail.ReadWrite\"],
username = event[\'username\'],
cache_file = \"token.cache\",
date_range = event[\'date_range\'],
endpoint = f\'https://graph.microsoft.com/v1.0/me/mailFolders/inbox/messages?$expand=attachments&$search=\"hasAttachments:true AND received:{event[\'date_range\']}\"\'
)
尝试使用此端点运行时,出现语法错误:
\"Syntax error in module \'xxx\': f-string: unmatched.
我不相信来自事件的数据格式存在问题,因为当我在端点中硬编码日期时,它与其他传入的事件数据一起工作正常。
让端点接受事件中显示的日期范围的正确格式是什么?
标签: python amazon-web-services aws-lambda