From 8c84d391610b67acc5bb20105189b022f3380f6b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Simon=20K=C3=BCnzel?= <simonk@fsmpi.rwth-aachen.de>
Date: Sat, 29 Mar 2025 01:32:31 +0100
Subject: [PATCH] Fix pipeline generator and bug in json serializable

---
 build_pipeline_generator.py                              | 9 +++++++--
 .../videoag_common/miscellaneous/json_serializable.py    | 3 ++-
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/build_pipeline_generator.py b/build_pipeline_generator.py
index 4b94a04..d228a6c 100644
--- a/build_pipeline_generator.py
+++ b/build_pipeline_generator.py
@@ -7,7 +7,8 @@ from argparse import ArgumentParser
 
 sys.path.append(str(Path("common_py/src/").resolve()))
 os.environ["VIDEOAG_CONFIG"] = "/dev/null"
-from videoag_common.miscellaneous import CJsonValue, JsonDataClass, JsonSerializableEnum, json_field, JsonOnlyDeserializable
+from videoag_common.miscellaneous import CJsonValue, JsonDataClass, JsonSerializableEnum, json_field, JsonSerializable, \
+    JsonTypes
 
 
 class OsType(JsonSerializableEnum):
@@ -15,7 +16,7 @@ class OsType(JsonSerializableEnum):
     ALPINE = "alpine"
 
 
-class OsModuleDependencies(JsonOnlyDeserializable):
+class OsModuleDependencies(JsonSerializable):
     
     def __init__(self, names_by_type: dict[OsType, set[str]] or None = None):
         super().__init__()
@@ -33,6 +34,10 @@ class OsModuleDependencies(JsonOnlyDeserializable):
                 names_list.append(val.as_string(max_length=100))
         return OsModuleDependencies(names_by_type)
     
+    def to_json(self) -> JsonTypes:
+        # Not supported/needed
+        raise NotImplementedError()
+    
     def update(self, other: "OsModuleDependencies"):
         for type, names in other._names_by_type.items():
             self._names_by_type[type].update(names)
diff --git a/common_py/src/videoag_common/miscellaneous/json_serializable.py b/common_py/src/videoag_common/miscellaneous/json_serializable.py
index 1fa64a2..e492d58 100644
--- a/common_py/src/videoag_common/miscellaneous/json_serializable.py
+++ b/common_py/src/videoag_common/miscellaneous/json_serializable.py
@@ -302,7 +302,8 @@ class JsonDataClass(JsonSerializable):
         
         args = {}
         for id, field in cls.__all_json_fields__.items():
-            unused_keys.remove(id)
+            if id in unused_keys:
+                unused_keys.remove(id)
             
             val = field.from_json(json, id)
             if val != dataclasses.MISSING:
-- 
GitLab