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

Remove Policy deprecations and set max_history default to None. #9119

Merged
merged 36 commits into from
Jul 19, 2021

Conversation

kedz
Copy link
Contributor

@kedz kedz commented Jul 13, 2021

Proposed changes:

  • Remove the following deprecated policy classes:
    • FormPolicy
    • MappingPolicy
    • FallbackPolicy
    • TwoStageFallbackPolicy
    • SklearnPolicy
  • Update the max history defaults in MemoizationPolicy.
  • Remove/edit tests that depended on deprecated modules.
  • Remove deprecated policies from docs.
  • Remove any soon-to-be-broken links from CHANGELOG.mdx to docs sections for these policies.

Status (please check what you already did):

  • Remove deprecated policy classes.
  • Update the max history defaults in policies
  • Remove/edit tests that depended on these modules
  • Remove deprecated policies from docs
  • Remove any soon-to-be-broken links from CHANGELOG.mdx to docs sections for these policies.
  • updated the changelog (please check changelog for instructions)
  • reformat files using black (please check Readme for instructions)

@kedz kedz requested a review from a team as a code owner July 13, 2021 23:41
@kedz kedz requested review from a team and aeshky and removed request for a team and aeshky July 13, 2021 23:41
from rasa.core.policies.form_policy import FormPolicy

suited_policies_for_forms = (FormPolicy, RulePolicy)
suited_policies_for_forms = (RulePolicy)
Copy link
Contributor

Choose a reason for hiding this comment

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

These parenthesis are doing nothing. You would need a comma to make it a tuple, but probably a tuple is not needed now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed the tuple and just now check that there is a rule policy instance in the config to handle forms.

@joejuzl
Copy link
Contributor

joejuzl commented Jul 15, 2021

reminder to tackle rasa.core.policies.memoization.py:L87:

"f""Please configure the max history in your configuration file, ""
f""currently 'max_history' is set to old default value of ""
f""'{max_history}'. If you want to have infinite max history ""
f""set it to 'None' explicitly. We will change the default value of ""
 f""'max_history' in the future to 'None'."","

@kedz kedz changed the title 3.0 Deprecation Warnings: Remove Policy deprecations Remove Policy deprecations and set max_history default to None. Jul 15, 2021
@kedz
Copy link
Contributor Author

kedz commented Jul 16, 2021

The CI tests are now passing but our core regression tests are failing.

Looking into this some more, I see that the problem is unrelated to this PR. It seems that required_slots in form definitions was optional for domain files before 2.6. After 2.6 not including was still supported but deprecated. This week, support for not including it got dropped in main as part of the move to 3.0. Now including required_slots is necessary or YAML validation will fail.

Unfortunately, the two repos we run core regression tests on (finanicial-demo and helpdesk-assistant) have not had their domain files updated. I have created PRs for each of them to add this field (here and here). Once they have merged core regression tests should work again.

Although none of the core policy regression tests include any of the deprecated policies removed in this PR so the core regression tests should not be affected by any of the changes here (in theory, I wanted to run core regression tests now to confirm this which is how I discovered they were broken). We could merge if this PR is blocking other work and the core regression tests will get fixed when those other repos update their domain files?

@kedz kedz requested a review from samsucik July 16, 2021 04:23
Copy link
Contributor

@samsucik samsucik left a comment

Choose a reason for hiding this comment

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

Overall looks good but I think we'll need to talk about how we deal with links to removed components, as well as with migration automation code that isn't for the current major version (in this case 3.x).

Co-authored-by: Sam Sucik <s.sucik@rasa.com>
@github-actions
Copy link
Contributor

@github-actions
Copy link
Contributor

Hey @kedz! 👋 To run model regression tests, comment with the /modeltest command and a configuration.

Tips 💡: The model regression test will be run on push events. You can re-run the tests by re-add status:model-regression-tests label or use a Re-run jobs button in Github Actions workflow.

Tips 💡: Every time when you want to change a configuration you should edit the comment with the previous configuration.

You can copy this in your comment and customize:

/modeltest

```yml
##########
## Available datasets
##########
# - "Carbon Bot" (NLU)
# - "Hermit" (NLU)
# - "Private 1" (NLU)
# - "Private 2" (NLU)
# - "Private 3" (NLU)
# - "Sara" (NLU)
# - "financial-demo" (NLU, Core)
# - "helpdesk-assistant" (NLU, Core)

##########
## Available NLU configurations
##########
# - "BERT + DIET(bow) + ResponseSelector(bow)"
# - "BERT + DIET(seq) + ResponseSelector(t2t)"
# - "Spacy + DIET(bow) + ResponseSelector(bow)"
# - "Spacy + DIET(seq) + ResponseSelector(t2t)"
# - "Sparse + BERT + DIET(bow) + ResponseSelector(bow)"
# - "Sparse + BERT + DIET(seq) + ResponseSelector(t2t)"
# - "Sparse + DIET(bow) + ResponseSelector(bow)"
# - "Sparse + DIET(seq) + ResponseSelector(t2t)"
# - "Sparse + Spacy + DIET(bow) + ResponseSelector(bow)"
# - "Sparse + Spacy + DIET(seq) + ResponseSelector(t2t)"

##########
## Available Core configurations
##########
# - "Rules"
# - "Rules + AugMemo"
# - "Rules + AugMemo + TED"
# - "Rules + Memo"
# - "Rules + Memo + TED"
# - "Rules + TED"

## Example configuration
#################### syntax #################
## include:
##   - dataset: ["<dataset_name>"]
##     config: ["<configuration_name>"]
#
## Example:
## include:
##  - dataset: ["Carbon Bot"]
##    config: ["Sparse + DIET(bow) + ResponseSelector(bow)"]
#
## Shortcut:
## You can use the "all" shortcut to include all available configurations or datasets
#
## Example: Use the "Sparse + EmbeddingIntent + ResponseSelector(bow)" configuration
## for all available datasets
## include:
##  - dataset: ["all"]
##    config: ["Sparse + DIET(bow) + ResponseSelector(bow)"]
#
## Example: Use all available configurations for the "Carbon Bot" and "Sara" datasets
## and for the "Hermit" dataset use the "Sparse + DIET + ResponseSelector(T2T)" and
## "BERT + DIET + ResponseSelector(T2T)" configurations:
## include:
##  - dataset: ["Carbon Bot", "Sara"]
##    config: ["all"]
##  - dataset: ["Hermit"]
##    config: ["Sparse + DIET(seq) + ResponseSelector(t2t)", "BERT + DIET(seq) + ResponseSelector(t2t)"]
#
## Example: Define a branch name to check-out for a dataset repository. Default branch is 'main'
## dataset_branch: "test-branch"
## include:
##  - dataset: ["Carbon Bot", "Sara"]
##    config: ["all"]
##
## Shortcuts:
## You can use the "all" shortcut to include all available configurations or datasets.
## You can use the "all-nlu" shortcut to include all available NLU configurations or datasets.
## You can use the "all-core" shortcut to include all available core configurations or datasets.

include:
 - dataset: ["Carbon Bot"]
   config: ["Sparse + DIET(bow) + ResponseSelector(bow)"]

```

@github-actions
Copy link
Contributor

/modeltest

include:
 - dataset: ["all-core"]
   config: ["all-core"]

@github-actions
Copy link
Contributor

The model regression tests have started. It might take a while, please be patient.
As soon as results are ready you'll see a new comment with the results.

Used configuration can be found in the comment.

@github-actions
Copy link
Contributor

Copy link
Contributor

@samsucik samsucik left a comment

Choose a reason for hiding this comment

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

Looks good, let's deal with the links and then we're good to go I think 🙂

Copy link
Contributor

@joejuzl joejuzl left a comment

Choose a reason for hiding this comment

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

I love the smell of deleted code in the morning 🥀

@kedz
Copy link
Contributor Author

kedz commented Jul 19, 2021

@samsucik I created an issue here to track dead docs links. With that in place can I get permission to merge?

@kedz kedz requested a review from samsucik July 19, 2021 14:22
@samsucik
Copy link
Contributor

@kedz I think so 😉

Copy link
Contributor

@samsucik samsucik left a comment

Choose a reason for hiding this comment

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

🚀

@kedz kedz merged commit 85626b9 into main Jul 19, 2021
@kedz kedz deleted the deprecate-policy branch July 19, 2021 16:39
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.

3.0 Deprecation Warnings: Remove Policy deprecations
3 participants