From 91e7235617de43c4142629b01eaf6e9e3c86d1ec Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Peter=20L=C3=BCnenschlo=C3=9F?= <peter.luenenschloss@ufz.de>
Date: Mon, 4 Mar 2024 20:55:30 +0100
Subject: [PATCH] Apply 1 suggestion(s) to 1 file(s)

---
 saqc/funcs/flagtools.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/saqc/funcs/flagtools.py b/saqc/funcs/flagtools.py
index 3ec5d839c..4f6e69c51 100644
--- a/saqc/funcs/flagtools.py
+++ b/saqc/funcs/flagtools.py
@@ -376,7 +376,11 @@ class FlagtoolsMixin:
             if target not in self._data:
                 self._data[target] = pd.Series(np.nan, index=self._data[field].index)
                 self._flags._data[target] = History(self._data[target].index)
-
+            if not self._data[field].index.equals(self._data[target].index):
+                raise ValueError(f'All Field and Target indices must match!\n'
+                                 f'Indices of {field} and {target} seem to be not congruent within the context of the given\n'
+                                 f'- fields: {fields}\n '
+                                 f'- and targets: {targets}')
             history = self._flags.history[field].copy(deep=True)
 
             if overwrite is False:
-- 
GitLab