From 841a28066b6a8d77af2986b0d7db72afa0cf1334 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Thu, 23 Nov 2023 01:04:37 +0100 Subject: [PATCH] Added support for generic kwargs to `publish_entities`. --- platypush/entities/managers/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/platypush/entities/managers/__init__.py b/platypush/entities/managers/__init__.py index 40692930f..243c3d98f 100644 --- a/platypush/entities/managers/__init__.py +++ b/platypush/entities/managers/__init__.py @@ -34,7 +34,7 @@ class EntityManager(ABC): return super().__new__(cls) @abstractmethod - def transform_entities(self, entities: Collection[Any]) -> Collection[Entity]: + def transform_entities(self, entities: Collection[Any], **_) -> Collection[Entity]: """ This method takes a list of entities in any (plugin-specific) format and converts them into a standardized collection of @@ -86,6 +86,7 @@ class EntityManager(ABC): self, entities: Optional[Collection[Any]], callback: Optional[EntitySavedCallback] = None, + **kwargs, ) -> Collection[Entity]: """ Publishes a list of entities. The downstream consumers include: @@ -106,7 +107,7 @@ class EntityManager(ABC): from platypush.entities import publish_entities transformed_entities = self._normalize_entities( - self.transform_entities(entities or []) + self.transform_entities(entities or [], **kwargs) ) publish_entities(transformed_entities, callback=callback)