question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

rasa lint might be a good idea

See original GitHub issue

Description of Problem: I am playing with rasa, let’s say for the first time. The basics worked and I got a new intent working. This worked fine and now I want to add a form. I change a yml/md file here and there and I get this error:

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File “/Users/vincent/Development/koaning-rasa/venv/bin/rasa”, line 8, in <module> sys.exit(main()) File “/Users/vincent/Development/koaning-rasa/venv/lib/python3.6/site-packages/rasa/main.py”, line 76, in main cmdline_arguments.func(cmdline_arguments) File “/Users/vincent/Development/koaning-rasa/venv/lib/python3.6/site-packages/rasa/cli/interactive.py”, line 60, in interactive zipped_model = train.train(args) File “/Users/vincent/Development/koaning-rasa/venv/lib/python3.6/site-packages/rasa/cli/train.py”, line 75, in train kwargs=extract_additional_arguments(args), File “/Users/vincent/Development/koaning-rasa/venv/lib/python3.6/site-packages/rasa/train.py”, line 40, in train kwargs=kwargs, File “uvloop/loop.pyx”, line 1417, in uvloop.loop.Loop.run_until_complete File “/Users/vincent/Development/koaning-rasa/venv/lib/python3.6/site-packages/rasa/train.py”, line 91, in train_async kwargs, File “/Users/vincent/Development/koaning-rasa/venv/lib/python3.6/site-packages/rasa/train.py”, line 130, in _train_async_internal new_fingerprint = await model.model_fingerprint(file_importer) File “/Users/vincent/Development/koaning-rasa/venv/lib/python3.6/site-packages/rasa/model.py”, line 208, in model_fingerprint stories = await file_importer.get_stories() File “/Users/vincent/Development/koaning-rasa/venv/lib/python3.6/site-packages/rasa/importers/importer.py”, line 261, in get_stories stories = await asyncio.gather(*stories) File “/Users/vincent/Development/koaning-rasa/venv/lib/python3.6/site-packages/rasa/importers/rasa.py”, line 55, in get_stories exclusion_percentage, File “/Users/vincent/Development/koaning-rasa/venv/lib/python3.6/site-packages/rasa/core/training/dsl.py”, line 210, in read_from_files f, domain, interpreter, template_variables, use_e2e File “/Users/vincent/Development/koaning-rasa/venv/lib/python3.6/site-packages/rasa/core/training/dsl.py”, line 238, in read_from_file return await reader.process_lines(lines) File “/Users/vincent/Development/koaning-rasa/venv/lib/python3.6/site-packages/rasa/core/training/dsl.py”, line 346, in process_lines raise ValueError(msg) ValueError: (‘Error in line 12: Invalid to parse arguments in line ' form{“name”: “schedule_form”'. Failed to decode parametersas a json object. Make sure the eventname is followed by a proper json object. Error: Expecting ',' delimiter: line 1 column 25 (char 24)’, “Invalid story file format. Failed to parse ‘/Users/vincent/Development/koaning-rasa/data/stories.md’”)

Five minutes later and I still don’t know what file nlu.md/stories.md/domain.yml I need to edit/fix. Something that could really help here is a command line tool that would lint the files. Probably a good idea to add rasa lint. This seems to be a package where setting files are central to the functionality, without a linter it can be rather daunting for a newcomer to debug their code.

I’ve tried using this:

rasa data validate

but it yields the same issue.

Overview of the Solution:

Preferably something like;

rasa lint Oddities found:

  • domain.yml cannot be parsed -> check line 12

Examples

There’s some other things that could be done in the linter.

rasa lint Oddities found:

  • domain.yml cannot be parsed -> check line 12 Un-used intents:
  • i_scream is never used

Definition of Done:

As a new user I mainly care about having tools that keep me on the “happy path” even when I make a config typo. At the moment the docs are a bit daunting. A linter tool could help.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:12 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
tmbocommented, May 12, 2020

I think mainly this should be checked before the training, a separate linting command is cherry on top

2reactions
erohmensingcommented, Oct 21, 2019

rasa lint could also act to sort/dump the config and domain to avoid unnecessary git diffs. We could also create a pre-commit hook to implement this functionality automatically if users opt-in by activating the hook

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: can't train stories - Rasa Open Source
I am trying to train a new bot, but I got these errors. $ python -m rasa_core.train -d domain.yml -s data/stories.md -o models/dialogue ......
Read more >
Telescope Cleaning Tutorial - SCT and RASA - YouTube
Your browser can 't play this video. ... Does the corrector plate on your Schmidt-Cassegrain or RASA telescope need a good cleaning?
Read more >
Avoid Ridiculous Failed Pipeline with Git Hooks
Lint check or linter is a tool that make sure everyone's code style in team follow the agreed standard. Linter is important to...
Read more >
Ep. 257: Locke Against Innate Ideas (Part One)
Locke thought all knowledge comes from experience, and this might seem ... set on doing philosophy for living but then thought better of...
Read more >
Q&A: Is Fabric Pilling Avoidable? - Threads Magazine
It is always a good idea to prewash fabric before sewing. Sometimes one washing will expose a tendency to pill. Cut two 6-inch-square...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found