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.
This commit is contained in:
Nick Guy 2025-06-17 17:56:15 +01:00
parent 4a82ab0b06
commit 88baa30d04

View file

@ -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"]]