Comments (6)
Powertools for AWS Lambda on-call checking in - we're investigating. Thank you so much for the preliminary investigation.
from aws-sdk-pandas.
After testing with version 2.34.2 of powertools using layers:
- arn:aws:lambda:eu-west-1:017000801446:layer:AWSLambdaPowertoolsPythonV2:65
- arn:aws:lambda:eu-west-1:336392948345:layer:AWSSDKPandas-Python312:4
on Python 3.12, I can confirm that the issue is fixed, thanks @heitorlessa. Closing the ticket
from aws-sdk-pandas.
So here's what is going on here. awswrangler
packages pymysql as a dependency in its lambda layers. In turn, pymysql has an optional dependency on the cryptography package. Because it's optional, we don't package it in the zip layer and therefore pymysql does not try to import it. This explains why you have no issue when using the awswrangler layer on its own.
On the other hand, recent versions of aws_lambda_powertools
do package cryptography as a dependency in their layer. As a result, when both layers are used, pymysql detects that cryptography is available from powertools and it tries to import it.
Now on the exception No module named '_cffi_backend'
. There seems to be an issue with the way cryptography was packaged in the powertools layer. I am able to reproduce the exception with this simple code:
import json
from aws_lambda_powertools.utilities.data_masking.provider.kms.aws_encryption_sdk import (
AWSEncryptionSDKProvider,
)
def lambda_handler(event, context):
# TODO implement
return {
'statusCode': 200,
'body': json.dumps('Hello from Lambda!')
}
which also raises No module named _cffi_backend
and as you can see does not involve awswrangler
. From the little research I have done, it looks like powertools uses the same base image to package their layers but cffi is sensitive to the base python version on which it's installed:
https://stackoverflow.com/questions/76443834/aws-lambda-python-3-10-no-module-named-cffi-backend
We have the same issue with numpy
and this is why we have one layer per python version when powertools does not.
In short, this is a powertools specific issue that they need to solve. I can open an issue with them to inform them.
from aws-sdk-pandas.
an extra test I did: the combination of arn:aws:lambda:eu-west-1:336392948345:layer:AWSSDKPandas-Python311:6 and arn:aws:lambda:eu-west-1:017000801446:layer:AWSLambdaPowertoolsPythonV2:11 in Python 3.11 did work
from aws-sdk-pandas.
we're making a patch release now to remove aws-encryption-sdk
from the Powertools Layer. I'll update as soon as it's out -- it'll be version 65.
from aws-sdk-pandas.
an extra note for whoever bumps into this -- we will be investigating the operational effort in adding a new layer per Python version in the near future.
from aws-sdk-pandas.
Related Issues (20)
- Support client-side parameter resolution in wr.athena.create_ctas_table HOT 1
- Cannot write parquet in an S3 path that includes white spaces when using ray HOT 1
- Provide option to skip commit in postgresql.to_sql to allow usage of transactions HOT 1
- Incorrect error message or implementation for datetime formatting? HOT 1
- Unsupported Athena type: json
- Requests for Additional Argument `name_function` on `awswrangler.s3.to_parquet()` HOT 1
- Support IAM Trusted Identity Propagation and Lake Formation with Athena
- Support IAM Trusted Identity Propagation with Redshift
- Upsert column parameters HOT 1
- Get column parameters HOT 2
- s3.read_parquet_table and exception "Unknown parameter in input: "ExcludeColumnSchema", must be one of: CatalogId, DatabaseName, TableName, Expression, NextToken, Segment, MaxResults" HOT 2
- The `to_property_graph` docstring in the Neptune module is not well written and does not describe the behavior of the function when the node already exists HOT 1
- Postgres upsert table creation
- Insight into error `awswrangler.exceptions.QueryFailed: Iceberg cannot access the requested resource` HOT 2
- athena.to_iceberg function is not deleting temp_table_xxxxx properly in Athena HOT 1
- Add s3_output parameter to athena.delete_from_iceberg_table method HOT 1
- wr.s3.download fits the whole file into memory, with 2x memory allocation
- Upsert mode for SQL Server HOT 1
- Lack of `verify` input to customize SSL verify option limits smooth usage of the package modules
- Allow more than parquet files in redshift copy from files function
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-sdk-pandas.