From c80593137b0b08ae497cabf874370101c9654fc9 Mon Sep 17 00:00:00 2001 From: Rebecca Graber Date: Wed, 4 Oct 2023 13:53:07 -0400 Subject: [PATCH] fixup!: docstring --- openedx_events/event_bus/__init__.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/openedx_events/event_bus/__init__.py b/openedx_events/event_bus/__init__.py index b846d23f..99d6a2e7 100644 --- a/openedx_events/event_bus/__init__.py +++ b/openedx_events/event_bus/__init__.py @@ -186,6 +186,18 @@ def _reset_state(sender, **kwargs): # pylint: disable=unused-argument def merge_publisher_configs(publisher_config_a, publisher_config_b): + """ + Merge two EVENT_BUS_PRODUCER_CONFIG maps + + Arguments: + publisher_config_a: An EVENT_BUS_PRODUCER_CONFIG-structured map + publisher_config_b: An EVENT_BUS_PRODUCER_CONFIG-structured map + + Returns: + A new EVENT_BUS_PRODUCER_CONFIG map created by combining the two maps. All event_type/topic pairs in + publisher_config_b are added to the publisher_config_a. If there is a conflict on whether a particular + event_type/topic pair is enabled, publisher_config_b wins out. + """ combined = {**publisher_config_a} for event_type, event_type_config_b in publisher_config_b.items(): event_type_config_combined = combined.get(event_type, {})