Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-1293

Module initialization error when using pyarrow with AWS Lambda

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: 0.5.0
    • Fix Version/s: None
    • Component/s: Python
    • Labels:
      None
    • Environment:
      AWS Lambda

      Description

      When using pyarrow in AWS Lambda function like this:

      import pyarrow as pa
      import pyarrow.parquet as pq
      import pandas as pd
      
      def lambda_handler(event, context):
          df = pd.DataFrame([data]) #data is dictionary
          table = pa.Table.from_pandas(df)
          pq.write_table(table, 'tmp/test.parquet', compression='snappy')
          table = pq.read_table('tmp/test.parquet')
          table.to_pandas()
          print(table)
          return "Success"
      

      Module initialization error occurs:

      module initialization error: [Errno 2] No such file or directory: '/var/task/__pycache__/_cffi__x762f05ffx6bf5342b.c'
      

      Deployment package was prepared by running following commands:

      virtualenv nameofenv
      source nameofenv/bin/active
      pip install pyarrow
      sudo apt-get install libsnappy-dev
      pip install python-snappy
      pip install pandas
      

      files from site-packages directory are than zipped together with lambda function.

        Attachments

          Activity

            People

            • Assignee:
              wesmckinn Wes McKinney
              Reporter:
              tmilicic Tanja Miličić
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: