visch
09/21/2021, 5:59 PMgit bisect
but instead of in git I want to do it with Meltano
My issue is I run
meltano elt tap-clickup target-jsonl --job_id b
And after my state saves and I run the job a second time I get this exception
Traceback (most recent call last):
File "/home/visch/git/tap-clickup/.meltano/loaders/target-jsonl/venv/bin/target-jsonl", line 8, in <module>
sys.exit(main())
File "/home/visch/git/tap-clickup/.meltano/loaders/target-jsonl/venv/lib/python3.8/site-packages/target_jsonl.py", line 94, in main
state = persist_messages(input_messages, config.get('destination_path', ''), config.get('do_timestamp_file', True))
File "/home/visch/git/tap-clickup/.meltano/loaders/target-jsonl/venv/lib/python3.8/site-packages/target_jsonl.py", line 59, in persist_messages
validators[o['stream']].validate(float_to_decimal(o['record']))
File "/home/visch/git/tap-clickup/.meltano/loaders/target-jsonl/venv/lib/python3.8/site-packages/jsonschema/validators.py", line 130, in validate
raise error
jsonschema.exceptions.ValidationError: 'true' is not of type 'integer', 'null'
Failed validating 'type' in schema['properties']['custom_fields']['items']['properties']['value']:
{'type': ['integer', 'null']}
On instance['custom_fields'][1]['value']:
'true'
So my debugging steps are
1. Generate an output file that repeats the error (meltano invoke tap-clickup --state state > out
)
2. Run cat out | meltano invoke target-jsonl
3. Find the error
Now I'm replicating the error which is great but my output file is roughly 106 lines so I have to try to find which issue this is. I've had this happen with other taps / targets while debugging. What I end up doing is throwing println's in the target to point me to the right place.
I wonder if we could do better like
cat out | meltano debugdata | meltano invoke target-jsonl
I'm tempting to write out a script but it's so much easier to throw a println in