Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

validate model config #7965

Merged
merged 10 commits into from
Feb 18, 2021
Merged

validate model config #7965

merged 10 commits into from
Feb 18, 2021

Conversation

wochinge
Copy link
Contributor

@wochinge wochinge commented Feb 16, 2021

Proposed changes:

  • fix gracefully handle wrong pipeline component format in config #7893
  • validate model configurations with a schema file
  • validate config files (endpoints.yml, credentials.yml) using a schema instead of a Python check
  • move schema files which are used by rasa.shared code but aren't in rasa.shared to rasa.shared
  • make language not a required key after double checking with Ty

Status (please check what you already did):

  • added some tests for the functionality
  • updated the documentation
  • updated the changelog (please check changelog for instructions)
  • reformat files using black (please check Readme for instructions)

filename: The path to the file which should be read.

Raises:
YamlValidationException: In case the model configuration doesn't match the
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's a different one than before but in my opinion the correct one. Double checked the code and nothing depends on the exact exception type.

@wochinge wochinge force-pushed the config-file-schema-validation branch from 8c85976 to 3bca31f Compare February 16, 2021 13:14
@wochinge wochinge requested a review from alwx February 17, 2021 14:22
@wochinge wochinge marked this pull request as ready for review February 17, 2021 14:25
@wochinge wochinge requested a review from a team February 17, 2021 14:25
content = read_file(filename)

rasa.shared.utils.validation.validate_yaml_schema(content, schema)
return read_yaml(content)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed how it works in my PR (#7968) but it should still be fine.

@wochinge wochinge merged commit 2574c46 into main Feb 18, 2021
@wochinge wochinge deleted the config-file-schema-validation branch February 18, 2021 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gracefully handle wrong pipeline component format in config
3 participants