Skip to content

Commit cac7cea

Browse files
committed
Merge branch '1.9.x'
2 parents e4fd3ac + 77e97de commit cac7cea

File tree

8 files changed

+50
-37
lines changed

8 files changed

+50
-37
lines changed

CHANGELOG.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,25 @@ This project adheres to `Semantic Versioning`_ starting with version 1.0.
1717

1818
.. towncrier release notes start
1919
20+
[1.9.2] - 2020-03-26
21+
^^^^^^^^^^^^^^^^^^^^
22+
23+
Improved Documentation
24+
----------------------
25+
- `#5497 <https://github.com/RasaHQ/rasa/pull/5497>`_: Fix documentation to bring back Sara.
26+
27+
28+
[1.9.1] - 2020-03-25
29+
^^^^^^^^^^^^^^^^^^^^
30+
31+
Bugfixes
32+
--------
33+
- `#5492 <https://github.com/rasahq/rasa/issues/5492>`_: Fix an issue where the deprecated ``queue`` parameter for the :ref:`event-brokers-pika`
34+
was ignored and Rasa Open Source published the events to the ``rasa_core_events``
35+
queue instead. Note that this does not change the fact that the ``queue`` argument
36+
is deprecated in favor of the ``queues`` argument.
37+
38+
2039
[1.9.0] - 2020-03-24
2140
^^^^^^^^^^^^^^^^^^^^
2241

docs/_templates/page.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{% extends "!page.html" %}
22

33
{% block footer %}
4+
{{ super() }}
45
<script type="text/javascript">
56
$(document).ready(function() {
67
$(".toggle > *").hide();
@@ -11,4 +12,4 @@
1112
})
1213
});
1314
</script>
14-
{% endblock %}
15+
{% endblock %}

docs/nlu/training-data-format.rst

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -223,17 +223,3 @@ Alternatively, you can add an "entity_synonyms" array to define several synonyms
223223
.. note::
224224
Please note that adding synonyms using the above format does not improve the model's classification of those entities.
225225
**Entities must be properly classified before they can be replaced with the synonym value.**
226-
227-
228-
Generating More Entity Examples
229-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
230-
231-
It is sometimes helpful to generate a bunch of entity examples, for
232-
example if you have a database of restaurant names. There are a couple
233-
of tools built by the community to help with that.
234-
235-
You can use `Chatito <https://rodrigopivi.github.io/Chatito/>`__ , a tool for generating training datasets in rasa's format using a simple DSL or `Tracy <https://yuukanoo.github.io/tracy>`__, a simple GUI to create training datasets for rasa.
236-
237-
However, creating synthetic examples usually leads to overfitting,
238-
it is a better idea to use :ref:`lookup-tables` instead if you have a large number
239-
of entity values.

docs/user-guide/docker/deploying-in-docker-compose.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,16 @@ a different Docker registry, such as `Google Container Registry <https://cloud.g
148148
To create your image:
149149

150150
#. Move your actions code to a folder ``actions`` in your project directory.
151-
Make sure to also add an empty ``actions/__init__.py`` file.
151+
Make sure to also add an empty ``actions/__init__.py`` file:
152+
153+
.. code-block:: bash
154+
155+
mkdir actions
156+
mv actions.py actions/actions.py
157+
touch actions/__init__.py # the init file indicates actions.py is a python module
158+
159+
The ``rasa/rasa-sdk`` image will automatically look for the actions in ``actions/actions.py``.
160+
152161
#. If your actions have any extra dependencies, create a list of them in a file,
153162
``actions/requirements-actions.txt``.
154163
#. Create a file named ``Dockerfile`` in your project directory,

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ exclude = "((.eggs | .git | .pytype | .pytest_cache | build | dist))"
99

1010
[tool.poetry]
1111
name = "rasa"
12-
version = "1.9.0"
12+
version = "1.9.2"
1313
description = "Open source machine learning framework to automate text- and voice-based conversations: NLU, dialogue management, connect to Slack, Facebook, and more - Create chatbots and voice assistants"
1414
authors = [ "Rasa Technologies GmbH <[email protected]>",]
1515
maintainers = [ "Tom Bocklisch <[email protected]>",]

rasa/core/brokers/pika.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
logger = logging.getLogger(__name__)
2828

2929
RABBITMQ_EXCHANGE = "rasa-exchange"
30+
DEFAULT_QUEUE_NAME = "rasa_core_events"
3031

3132

3233
def initialise_pika_connection(
@@ -224,7 +225,7 @@ def __init__(
224225
username: Text,
225226
password: Text,
226227
port: Union[int, Text] = 5672,
227-
queues: Union[List[Text], Tuple[Text], Text, None] = ("rasa_core_events",),
228+
queues: Union[List[Text], Tuple[Text], Text, None] = None,
228229
should_keep_unpublished_messages: bool = True,
229230
raise_on_failure: bool = False,
230231
log_level: Union[Text, int] = os.environ.get(
@@ -278,7 +279,7 @@ def rasa_environment(self) -> Optional[Text]:
278279

279280
@staticmethod
280281
def _get_queues_from_args(
281-
queues_arg: Union[List[Text], Tuple[Text], Text, None], kwargs: Any,
282+
queues_arg: Union[List[Text], Tuple[Text], Text, None], kwargs: Any
282283
) -> Union[List[Text], Tuple[Text]]:
283284
"""Get queues for this event broker.
284285
@@ -326,12 +327,15 @@ def _get_queues_from_args(
326327
if queue_arg:
327328
return queue_arg # pytype: disable=bad-return-type
328329

329-
raise ValueError(
330-
f"Could not initialise `PikaEventBroker` due to invalid "
331-
f"`queues` or `queue` argument in constructor. See "
332-
f"{DOCS_URL_PIKA_EVENT_BROKER}."
330+
raise_warning(
331+
f"No `queues` or `queue` argument provided. It is suggested to "
332+
f"explicitly specify a queue as described in "
333+
f"{DOCS_URL_PIKA_EVENT_BROKER}. "
334+
f"Using the default queue '{DEFAULT_QUEUE_NAME}' for now."
333335
)
334336

337+
return [DEFAULT_QUEUE_NAME]
338+
335339
@classmethod
336340
def from_endpoint_config(
337341
cls, broker_config: Optional["EndpointConfig"]
@@ -399,7 +403,7 @@ def _run_pika_io_loop(self) -> None:
399403
self._pika_connection.ioloop.start()
400404

401405
def is_ready(
402-
self, attempts: int = 1000, wait_time_between_attempts_in_seconds: float = 0.01,
406+
self, attempts: int = 1000, wait_time_between_attempts_in_seconds: float = 0.01
403407
) -> bool:
404408
"""Spin until the pika channel is open.
405409

rasa/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# this file will automatically be changed,
22
# do not add anything but the version number here!
3-
__version__ = "1.9.0"
3+
__version__ = "1.9.2"

tests/core/test_broker.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from rasa.core.brokers.broker import EventBroker
99
from rasa.core.brokers.file import FileEventBroker
1010
from rasa.core.brokers.kafka import KafkaEventBroker
11-
from rasa.core.brokers.pika import PikaEventBroker
11+
from rasa.core.brokers.pika import PikaEventBroker, DEFAULT_QUEUE_NAME
1212
from rasa.core.brokers.sql import SQLEventBroker
1313
from rasa.core.events import Event, Restarted, SlotSet, UserUttered
1414
from rasa.utils.endpoints import EndpointConfig, read_endpoint_config
@@ -53,9 +53,9 @@ def test_pika_message_property_app_id(monkeypatch: MonkeyPatch):
5353
"queue_arg,queues_arg,expected,warning",
5454
[
5555
# default case
56-
(None, ["rasa_core_events"], ["rasa_core_events"], None),
56+
(None, ["q1"], ["q1"], None),
5757
# only provide `queue`
58-
("rasa_core_events", None, ["rasa_core_events"], FutureWarning),
58+
("q1", None, ["q1"], FutureWarning),
5959
# supplying a list for `queue` works too
6060
(["q1", "q2"], None, ["q1", "q2"], FutureWarning),
6161
# `queues` arg supplied, takes precedence
@@ -64,11 +64,13 @@ def test_pika_message_property_app_id(monkeypatch: MonkeyPatch):
6464
("q1", ["q2", "q3"], ["q2", "q3"], FutureWarning),
6565
# only supplying `queues` works, and queues is a string
6666
(None, "q1", ["q1"], None),
67+
# no queues provided. Use default queue and print warning.
68+
(None, None, [DEFAULT_QUEUE_NAME], UserWarning),
6769
],
6870
)
6971
def test_pika_queues_from_args(
70-
queues_arg: Union[Text, List[Text], None],
7172
queue_arg: Union[Text, List[Text], None],
73+
queues_arg: Union[Text, List[Text], None],
7274
expected: List[Text],
7375
warning: Optional[Type[Warning]],
7476
monkeypatch: MonkeyPatch,
@@ -82,14 +84,6 @@ def test_pika_queues_from_args(
8284
assert pika_producer.queues == expected
8385

8486

85-
def test_pika_invalid_queues_argument(monkeypatch: MonkeyPatch):
86-
# patch PikaEventBroker so it doesn't try to connect to RabbitMQ on init
87-
monkeypatch.setattr(PikaEventBroker, "_run_pika", lambda _: None)
88-
89-
with pytest.raises(ValueError):
90-
PikaEventBroker("", "", "", queues=None, queue=None)
91-
92-
9387
def test_no_broker_in_config():
9488
cfg = read_endpoint_config(DEFAULT_ENDPOINTS_FILE, "event_broker")
9589

0 commit comments

Comments
 (0)