From 88baa30d04275b3ec8bc7d5f51bfced6e9f16c6f Mon Sep 17 00:00:00 2001 From: Nick Guy Date: Tue, 17 Jun 2025 17:56:15 +0100 Subject: [PATCH] Add logging for missing "object" key in transform method Introduce logging to handle cases where the "object" key is missing from the input data. This helps with debugging by printing the data in JSON format before returning it unchanged. --- api/pelican.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/api/pelican.py b/api/pelican.py index d7f223b..337ded5 100644 --- a/api/pelican.py +++ b/api/pelican.py @@ -1,3 +1,5 @@ +import json + from api import Api, ApiAuthType from typing import Tuple @@ -18,6 +20,10 @@ class PelicanApi(Api): } def transform(self, data): + if "object" not in data: + print("No object in data") + print(json.dumps(data)) + return data type = data["object"] if type == "list": return [self.transform(x) for x in data["data"]]