Repository: RasaHQ/rasa

Issue:
 Tried to set non existent slot 'count_list'. Make sure you added all your slots to your domain file.
<!-- THIS INFORMATION IS MANDATORY - YOUR ISSUE WILL BE CLOSED IF IT IS MISSING. If you don't know your Rasa version, use `rasa --version`. 
Please format any code or console output with three ticks ``` above and below.
If you are asking a usage question (e.g. "How do I do xyz") please post your question on https://forum.rasa.com instead -->

**Rasa version**: 1.1.3

**Rasa X version** (if used & relevant):Not using

**Python version**: 3.6.8

**Operating system** (windows, osx, ...): Windows 10

**Issue**: When i tried to use interactive learning getting this error though i mentioned all the slots in domain file.. It was working well earlier in rasa==1.0.7 version.



**Error (including full traceback)**:
```
2019-06-17 19:35:24 DEBUG    rasa.core.tracker_store  - Recreating tracker for id 'ca2c5d2b07f140bb90668586f1c28b10'
2019-06-17 19:35:24 DEBUG    rasa.core.processor  - Received user message 'list all impacted cis' with intent '{'name': 'ci_info', 'confidence': 0.9596539735794067}' and entities '[{'start': 0, 'end': 4, 'value': 'List', 'entity': 'count_list', 'confidence': 0.9737233844587407, 'extractor': 'CRFEntityExtractor', 'processors': ['EntitySynonymMapper']}, {'start': 9, 'end': 17, 'value': 'Impacted', 'entity': 'impa_noimpa', 'confidence': 0.9975736855043231, 'extractor': 'CRFEntityExtractor', 'processors': ['EntitySynonymMapper']}]'
2019-06-17 19:35:24 DEBUG    rasa.core.processor  - Current slot values:
        count_list: List
        filter1: None
        impa_noimpa: Impacted
        item_text: None
        item_value: None
        open_close: None
2019-06-17 19:35:24 DEBUG    rasa.core.processor  - Logged UserUtterance - tracker now has 4 events
2019-06-17 19:35:25 DEBUG    rasa.core.tracker_store  - Recreating tracker for id 'ca2c5d2b07f140bb90668586f1c28b10'
? Is the intent 'ci_info' correct for '[list](count_list:List) all [impacted](impa_noimpa:Impacted) cis' and are all entities labeled correctly?  Yes
2019-06-17 19:35:30 DEBUG    rasa.core.tracker_store  - Recreating tracker for id 'ca2c5d2b07f140bb90668586f1c28b10'
2019-06-17 19:35:30 DEBUG    rasa.core.policies.memoization  - Current tracker state [None, None, None, {}, {'entity_count_list': 1.0, 'intent_ci_info': 1.0, 'slot_count_list_0': 1.0, 'slot_impa_noimpa_0': 1.0, 'prev_action_listen': 1.0, 'entity_impa_noimpa': 1.0}]
2019-06-17 19:35:30 DEBUG    rasa.core.policies.memoization  - There is a memorised next action '8'
2019-06-17 19:35:30 DEBUG    rasa.core.policies.ensemble  - Predicted next action using policy_0_MemoizationPolicy
2019-06-17 19:35:30 DEBUG    rasa.core.tracker_store  - Recreating tracker for id 'ca2c5d2b07f140bb90668586f1c28b10'
2019-06-17 19:35:30 ERROR    rasa.core.trackers  - Tried to set non existent slot 'count_list'. Make sure you added all your slots to your domain file.
2019-06-17 19:35:30 ERROR    rasa.core.trackers  - Tried to set non existent slot 'impa_noimpa'. Make sure you added all your slots to your domain file.
------
Chat History

 #    Bot                                                                                        You
────────────────────────────────────────────────────────────────────────────────────────────────────────────
 1    action_listen
────────────────────────────────────────────────────────────────────────────────────────────────────────────
 2                                         [list](count_list:List) all [impacted](impa_noimpa:Impacted) cis
                                                                                       intent: ci_info 0.96
────────────────────────────────────────────────────────────────────────────────────────────────────────────
 3    slot{"count_list": "List"}
      slot{"impa_noimpa": "Impacted"}
```

**Command or request that led to error**:
```
rasa interactive --debug --endpoints endpoints.yml
```

**Content of configuration file (config.yml)** (if relevant):
```yml


```

**Content of domain file (domain.yml)** (if relevant):
```yml

```


Discussion:

Patch:
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 5058ae39943..790785a1f48 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -33,6 +33,8 @@ Fixed
 -----
 - all temporal model files are now deleted after stopping the Rasa server
 - ``rasa shell nlu`` now outputs unicode characters instead of ``\uxxxx`` codes
+- ``x in AnySlotDict`` is now ``True`` for any ``x``, which fixes empty slot warnings in
+  interactive learning
 - ``rasa train`` now also includes NLU files in other formats than the Rasa format
 
 
diff --git a/rasa/core/trackers.py b/rasa/core/trackers.py
index 054f15bec22..c2061110e06 100644
--- a/rasa/core/trackers.py
+++ b/rasa/core/trackers.py
@@ -53,6 +53,9 @@ class AnySlotDict(dict):
         value = self[key] = Slot(key)
         return value
 
+    def __contains__(self, key):
+        return True
+
 
 class DialogueStateTracker(object):
     """Maintains the state of a conversation.


Test patch:
diff --git a/tests/core/test_trackers.py b/tests/core/test_trackers.py
index 07bd5a83762..e9056a4a764 100644
--- a/tests/core/test_trackers.py
+++ b/tests/core/test_trackers.py
@@ -5,13 +5,16 @@ import fakeredis
 import pytest
 import tempfile
 import os
+import logging
 
 import rasa.utils.io
 from rasa.core import training, restore
 from rasa.core import utils
+from rasa.core.slots import Slot
 from rasa.core.actions.action import ACTION_LISTEN_NAME
 from rasa.core.domain import Domain
 from rasa.core.events import (
+    SlotSet,
     UserUttered,
     ActionExecuted,
     Restarted,
@@ -567,3 +570,15 @@ def test_last_executed_has_not_name():
     tracker = get_tracker(events)
 
     assert tracker.last_executed_action_has("another") is False
+
+
+@pytest.mark.parametrize("key, value", [("asfa", 1), ("htb", None)])
+def test_tracker_without_slots(key, value, caplog):
+    event = SlotSet(key, value)
+    tracker = DialogueStateTracker.from_dict("any", [])
+    assert key in tracker.slots
+    with caplog.at_level(logging.INFO):
+        event.apply_to(tracker)
+        v = tracker.get_slot(key)
+        assert v == value
+    assert len(caplog.records) == 0