chauncy wilson
05/06/2024, 4:37 PM{
data:[
{
"child_context": "...",
"extra_stuff": "...",
...
}
{
"child_context": "...",
"extra_stuff": "...",
...
}
]
}
or the way it appears in the out.jsonl file
{"type":"RECORD","stream":"endpoint","record":{"data":[{"child_context":"id1","extra_stuff":"value"}{"child_context":"id2","extra_stuff":"value"}]}}
The issue I have is that the tap only notices and runs the first child_context but I need it to run for each one. Can anyone help me out?Edgar Ramírez (Arch.dev)
05/06/2024, 6:09 PMchauncy wilson
05/06/2024, 6:15 PMEdgar Ramírez (Arch.dev)
05/06/2024, 6:15 PMchauncy wilson
05/06/2024, 6:18 PMdef get_child_context(self, record: dict, context: dict | None) -> dict | None:
data_list = record['data'] # Ensure data is a list (empty list if not)
for item in data_list :
if isinstance(item, dict) and item.get("client_id"): # Check if item is a dictionary and has "client_id"
return {"client_id": item.get("client_id")}
note: I can't move the json record path forward in the client.py file because the different streams have different formatting returnedEdgar Ramírez (Arch.dev)
05/06/2024, 6:19 PMget_child_context
, not generate_child_contexts
Edgar Ramírez (Arch.dev)
05/06/2024, 6:19 PMget_child_context
for use cases like yours.chauncy wilson
05/06/2024, 6:19 PMchauncy wilson
05/06/2024, 6:36 PMEdgar Ramírez (Arch.dev)
05/06/2024, 6:49 PM