From 3f87b7fa0684d1ba444d8a5526e4405384fb9666 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Mon, 11 Nov 2024 15:27:45 +0100 Subject: [PATCH] Include only fields that are present in the source object --- experimental/dbx2dab/main.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/experimental/dbx2dab/main.py b/experimental/dbx2dab/main.py index 7834bc3f..bfebaebf 100644 --- a/experimental/dbx2dab/main.py +++ b/experimental/dbx2dab/main.py @@ -84,9 +84,14 @@ class Job: permission["level"] = permission["permission_level"] permission.pop("permission_level") + # Filter out keys that are not in the base configuration + filtered_ordered_keys = [k for k in ordered_keys if k in obj] + return { "resources": { - "jobs": {self.normalized_key(): {k: obj[k] for k in ordered_keys}} + "jobs": { + self.normalized_key(): {k: obj[k] for k in filtered_ordered_keys} + } } }