Boto3 s3.get_object_attributes 不工作

Boto3 s3.get_object_attributes not working

我正在尝试从我的 lambda 获取 s3 对象元数据。根据 boto3 文档,执行此操作的最佳方法是使用 .get_object_attributes 但是当我尝试这样做时,我得到:'S3' object has no attribute 'get_object_attributes': AttributeError。 get_object 调用正常。

s3_client = boto3.client('s3')
s3_client.get_object(Bucket=source_bucket_name, Key=file_name)
s3_client.get_object_attributes(Bucket=source_bucket_name, Key=file_name)

需要上传最新版本的botocore和boto3到lambda。