meltano: bug: meltano run with any tap and `target-snowflake` fails at the end of the run, even though it works when piped with `meltano invoke`

Meltano Version

2.19.0

Python Version

3.10

Bug scope

CLI (options, error messages, logging, etc.)

Operating System

MacOS 13.4 (22F66) Ventura

Description

I have added target-snowflake (transferwise variant) and configured it correctly. It works when invoked alone using meltano invoke target-snowflake.

Invoking a tap and piping into the target also works: meltano invoke tap-slack | meltano invoke target-snowflake

However, using meltano run results in a crash: meltano run tap-slack target-snowflake

image

There is no useful information given by the logs.

I tried using tap-csv - it doesn’t work either.

👉 Slack thread

Code

Here is the config:

version: 1
default_environment: dev
project_id: c35e4650-7eda-4f6e-aae8-f331ae5615a3
environments:
- name: dev
- name: staging
- name: prod
plugins:
  extractors:
  - name: tap-slack
    variant: meltanolabs
    pip_url: git+https://github.com/MeltanoLabs/tap-slack.git
    config:
      channel_types:
      - public_channel
      - private_channel
      selected_channels:
      - <redacted>
      start_date: '2023-01-01'
      thread_lookback_days: 10
      include_admin_streams: true
      load_schema: meltano_slack
    select:
    - users.id
  - name: tap-csv
    variant: meltanolabs
    pip_url: git+https://github.com/MeltanoLabs/tap-csv.git
    load_schema: meltano_csv
    config:
      add_metadata_columns: true
      files: '[{"entity": "meubles", "path": "SampleCSVFile_10600kb.csv","keys":["name"]}]'
  loaders:
  - name: target-snowflake
    variant: transferwise
    pip_url: pipelinewise-target-snowflake
    config:
      account: <redacted>
      dbname: <redacted>
      user: meltano_user
      warehouse: COMPUTE_WH
      file_format: func.my_parquet_format
      role: meltano_role
      s3_bucket: backend-snapshot-copy
      s3_key_prefix: snowflake-imports/
      stage: backend.my_s3_stage
      default_target_schema: meltano

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 18 (4 by maintainers)

Most upvoted comments

Awesome, thanks for making the link between this error and pyarrow! That was indeed the problem 🕵️

The fix

I first listed all dependencies from target-snowflake using .meltano/loaders/target-snowflake/venv/bin/python -m pip freeze.

Output

asn1crypto==1.5.1
attrs==23.1.0
backoff==1.10.0
boto3==1.26.149
botocore==1.29.149
certifi==2023.5.7
cffi==1.15.1
charset-normalizer==2.1.1
ciso8601==2.3.0
cryptography==36.0.2
filelock==3.12.0
idna==3.4
inflection==0.5.1
jmespath==0.10.0
joblib==1.1.0
jsonschema==3.2.0
numpy==1.24.3
oscrypto==1.3.0
pandas==1.4.4
pipelinewise-singer-python==1.3.0
pipelinewise-target-snowflake==2.2.0
pyarrow==8.0.0
pycparser==2.21
pycryptodomex==3.18.0
PyJWT==2.7.0
pyOpenSSL==22.0.0
pyrsistent==0.19.3
python-dateutil==2.8.2
pytz==2020.5
requests==2.31.0
s3transfer==0.6.1
simplejson==3.17.2
six==1.16.0

We can see pyarrow==8.0.0 💡

In parallel, I also found https://github.com/Homebrew/homebrew-core/issues/125329 which suggests that PyArrow > 9 fixes the issue. I installed the latest (pyarrow==12.0.*), and this fixed the problem 🎉

Now I have a warning from target-snowflake that the version is incompatible, but since it works, I’m fine with having a warning 🙃 UserWarning: You have an incompatible version of 'pyarrow' installed (12.0.1), please install a version that adheres to: 'pyarrow<8.1.0,>=8.0.0; extra == "pandas"

But at least, nothing crashes anymore 🎉 🎉

What’s next?

There’s still at least ~1/2 months left before I can try convincing people from switchting to Meltano. I’ll see whether we use the Wise or the Meltano variant at this time.

  • It’s slightly hard to have direct faith in the Meltano variants in general, because they lack stars on Github.
  • We’re already using the Pipelinewise’s target in production, so at least we know it works - changing the target might be a bet we’re not willing to make

Thanks for the support again 🙏