Commit de96522e authored by Mikhail Karnevskiy's avatar Mikhail Karnevskiy
Browse files

Avoid [] as default parameter

parent 736c3578
Pipeline #6442 passed with stage
in 47 seconds
...@@ -153,7 +153,7 @@ class AsapoSender: ...@@ -153,7 +153,7 @@ class AsapoSender:
def __attrs_post_init__(self): def __attrs_post_init__(self):"Receiver created with ingest_mode=%s", self.ingest_mode)"Receiver created with ingest_mode=%s", self.ingest_mode)
def send_data(self, data, metadata, acknowledge=[], ack_dependencies=None): def send_data(self, data, metadata, acknowledge=None, ack_dependencies=None):
"Sending data with id=%s name=%s", "Sending data with id=%s name=%s",
metadata["_id"], metadata["name"]) metadata["_id"], metadata["name"])
...@@ -162,6 +162,8 @@ class AsapoSender: ...@@ -162,6 +162,8 @@ class AsapoSender:
if ack_dependencies is None: if ack_dependencies is None:
ack_dependencies = set([metadata["_id"]]) ack_dependencies = set([metadata["_id"]])
if acknowledge is None:
acknowledge = []
for out_id in acknowledge: for out_id in acknowledge:
if out_id not in self._ids_to_acknowledge: if out_id not in self._ids_to_acknowledge:
self._ids_to_acknowledge[out_id] = ack_dependencies self._ids_to_acknowledge[out_id] = ack_dependencies
...@@ -80,7 +80,7 @@ class Worker: ...@@ -80,7 +80,7 @@ class Worker:
""" """
pass pass
def send(self, data, metadata, acknowledge=[], ack_dependencies=None): def send(self, data, metadata, acknowledge=None, ack_dependencies=None):
if self.sender: if self.sender:
self.sender.send_data( self.sender.send_data(
data, metadata, acknowledge=acknowledge, ack_dependencies=to_set(ack_dependencies)) data, metadata, acknowledge=acknowledge, ack_dependencies=to_set(ack_dependencies))
...@@ -88,7 +88,7 @@ class Worker: ...@@ -88,7 +88,7 @@ class Worker:
raise ConfigurationError( raise ConfigurationError(
"Worker wants to send data, but no sender configured!") "Worker wants to send data, but no sender configured!")
def send_acknowledgement(self, acknowledge=[]): def send_acknowledgement(self, acknowledge=None):
self._acknowledge(self.sender.data_source, acknowledge) self._acknowledge(self.sender.data_source, acknowledge)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment