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

make sure Domain.fromDict(domain) doesn't change its input domain #5794

Merged
merged 4 commits into from
May 14, 2020

Conversation

chkoss
Copy link
Contributor

@chkoss chkoss commented May 8, 2020

Proposed changes:
Previously, in rasa.core.domain. Domain.fromDict and Domain.__init__ could alter their inputs because of the way Domain.collect_slots and Domain.collect_intent_properties were implemented.
This PR makes sure these collect functions don't alter their inputs.

This is related to https://github.com/RasaHQ/rasa-x/pull/2669, which fixes an issue in Rasa X that was caused by such a domain dictionary alteration.

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)

@chkoss chkoss requested a review from wochinge May 8, 2020 12:18
Copy link
Contributor

@wochinge wochinge left a comment

Choose a reason for hiding this comment

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

Thanks for also applying the fix here!

  • I think this should go in the 1.10.x branch.
  • Also, it would be great to add a test which makes sure that from_dict does not change the input dictionary.
  • can you link the Rasa X PR / issue where we fixed in this PR so that we have the connection?

changelog/5794.improvement.rst Show resolved Hide resolved
rasa/core/domain.py Show resolved Hide resolved
@chkoss chkoss changed the base branch from master to 1.10.x May 11, 2020 15:10
@chkoss chkoss requested a review from wochinge May 12, 2020 10:40
Copy link
Contributor

@wochinge wochinge left a comment

Choose a reason for hiding this comment

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

🎸 🧗‍♀️

tests/core/test_domain.py Outdated Show resolved Hide resolved
tests/core/test_domain.py Show resolved Hide resolved
rasa/core/domain.py Show resolved Hide resolved
@chkoss chkoss merged commit 911acc0 into 1.10.x May 14, 2020
@chkoss chkoss deleted the domain-from-dict branch May 14, 2020 13:12
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.

2 participants