This is an automated email from the ASF dual-hosted git repository.
bossenti pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/streampipes.git
The following commit(s) were added to refs/heads/dev by this push:
new 5f1107aab4 fix: do not overwrite timestamp in output event of a
function (#2548)
5f1107aab4 is described below
commit 5f1107aab441932ecd46a6f2e10de9b56802dfec
Author: Tim <[email protected]>
AuthorDate: Wed Mar 13 14:42:46 2024 +0100
fix: do not overwrite timestamp in output event of a function (#2548)
* fix: do not overwrite timestamp if available
* style: adapt styling
---
.../streampipes/functions/streampipes_function.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git
a/streampipes-client-python/streampipes/functions/streampipes_function.py
b/streampipes-client-python/streampipes/functions/streampipes_function.py
index 6e93f1d2fa..90521f1934 100644
--- a/streampipes-client-python/streampipes/functions/streampipes_function.py
+++ b/streampipes-client-python/streampipes/functions/streampipes_function.py
@@ -63,7 +63,8 @@ class StreamPipesFunction(ABC):
-------
None
"""
- event["timestamp"] = int(1000 * time())
+ if "timestamp" not in event.keys():
+ event["timestamp"] = int(1000 * time())
self.output_collectors[stream_id].collect(event)
def getFunctionId(self) -> FunctionId: