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:
parent
4a82ab0b06
commit
88baa30d04
1 changed files with 6 additions and 0 deletions
|
@ -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"]]
|
||||
|
|
Loading…
Reference in a new issue