Test Pipelets in IDE terminal

Hi everybody,
I am trying to write and test my own pipelets. When following the tutorial video I am trying to test the second version of the publication_date pipelet, where we added a configurable option. However, when testing this version with the following command:
pipelet consume publication_date.py -i test_item_title.json -c '{"match_in_title": true}'
I get this error:
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)

I tested the pipelet hardcoding the configuration to true and it worked. I does work as well when I upload it and use it in my pipeline.
So I suppose the problem is in the -c flag, or better in the string I am passing. I tried to invert the ’ and " in the above command, but that didn´t change anything and the error persisted.
Can you guys help me with a solution to my problem, so I can test my pipelets easily?



Welcome @alexRadebeul :dizzy:

1 Like

Hi Alex,

Your supposition that this has to do with the quoting is likely correct. Are you on Windows by any chance? Which terminal are you using there?


1 Like

Hey @alexRadebeul thanks for the question. Indeed, as Patrice says, you might need to properly escape the quote marks depending on which terminal you’re using on Windows. However, just looking through the test_item_title.json code extract from the tutorial it seems the new lines are not properly encoded so I think you might run into similar issues there as well if you’ve referenced the same code.

Thank you @pneff and @sciurus_vulgaris, it was indeed the time old problem of escaping quotation marks in the windows terminal.
The command
pipelet consume publication_date.py -i test_item_title.json -c '{\"match_in_title\": true}'
worked like a charm.

Thanks a lot.