AWS Pandas SDK for Lambda is missing packages

0

I'm trying to create a Lambda function which basically imports a .csv file from an S3 bucket, transforms the data little bit and then save another file in S3. I'm using Python 3.11 runtime and installed PandasSDK for Python 3.11 as the layer of my Lambda function.

When I invoke the function, the first error that came was that the 'fsspec' optional package was not installed.

Then I manually created a layer with 'fsspec' package and then a new message came:

"errorMessage": "Unable to import module 'lambda_function': Install s3fs to access S3".

I tried to create a layer for s3fs, but even after that the same error appears.

AWS Pandas SDK was supposed to have all AWS Wrangler functions available to import / export data from S3 buckets. I tried many things so far but I can't find a proper answer and i'm stuck now in my development.

demandé il y a 9 mois648 vues
1 réponse
0
Réponse acceptée

After better analyzing the code, I was using the "normal" pandas way to try to ingest the data into S3. I changed the code to use the "to_csv" from awsrwrangler package, and it worked!

répondu il y a 9 mois
profile pictureAWS
EXPERT
vérifié il y a 9 mois

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions