Hi guys, I'm currently trying to get the tap-paypa...
# plugins-general
t
Hi guys, I'm currently trying to get the tap-paypal (https://github.com/Yoast/singer-tap-paypal) working. After setting it up in the meltano.yml with all necessary configuration parameters I tried to invoke the tap for testing. Unfortunately I get the following error-message:
tap-paypal             | INFO Syncing stream: paypal_transactions
tap-paypal             | CRITICAL paypal_transactions() argument after ** must be a mapping, not NoneType
tap-paypal             | Traceback (most recent call last):
tap-paypal             |   File "/workspaces/meltano-staging/.meltano/extractors/tap-paypal/venv/bin/tap-paypal", line 8, in <module>
tap-paypal             |     sys.exit(main())
tap-paypal             |   File "/workspaces/meltano-staging/.meltano/extractors/tap-paypal/venv/lib/python3.8/site-packages/singer/utils.py", line 229, in wrapped
tap-paypal             |     return fnc(*args, **kwargs)
tap-paypal             |   File "/workspaces/meltano-staging/.meltano/extractors/tap-paypal/venv/lib/python3.8/site-packages/tap_paypal/tap.py", line 48, in main
tap-paypal             |     sync(paypal, args.state, catalog, args.config['start_date'])
tap-paypal             |   File "/workspaces/meltano-staging/.meltano/extractors/tap-paypal/venv/lib/python3.8/site-packages/tap_paypal/sync.py", line 67, in sync
tap-paypal             |     for row in tap_data(**stream_state):
tap-paypal             | TypeError: paypal_transactions() argument after ** must be a mapping, not NoneType
The tap seems to need a state file and I'm not sure how Meltano handles that. Maybe some of you can help me 🙂
v
Normally meltano will generate the state file for you, but it looks like this tap requires one at the start. Maybe someone at Meltano can point how to seed the initial state file or something? The quick fix is to do something like state.json
Copy code
{
  "bookmarks": {
    "paypal_transactions": {
      "start_date": "2021-01-01T00:00:00+0000"
    }
  }
}
meltano invoke tap-paypal --state state.json
I haven't seen a tap require a state file for a start_date this seems odd for a tap to do
But it could be a thing, I'm still relatively new!
t
Thanks Derek! Using the quick fix and waiting for someone of Meltano for hopefully explaining it to me 🙂
v
Also if you're using elt you can use
--state
as well 😄
e
Using state for initial sync is definitely not typical. Not really outside of the spec as it's rather liberal when it comes to state handling by the tap. So yeah, the workaround that @visch suggests should work, and you'd only need it in the initial sync. So, the first time, you run
Copy code
meltano elt tap-paypal my-target --state state.json --job_id=paypal_job
but the next time, you can omit
--state
as it'll already be stored in meltano's system db
Copy code
meltano elt tap-paypal my-target --job_id=paypal_job
t
Ok guys, thanks for your help! 🙂