Stéphane Burwash
04/14/2022, 2:42 PM{
identifiers{ id: 12345}
data: {all_that_good_shit: ...}
}
I'm trying to set my replication key and primary key as a nested property, but the sdk really dont like thatvisch
04/14/2022, 3:04 PMedgar_ramirez_mondragon
04/14/2022, 3:10 PMIt'd be curious someday to have Singer's primary and replication keys use json paths as that'd solve this without having to touch the data@visch That may be relatively easy to implement in the SDK 🙂. Would you mind filing an issue? I think the only place we'd need to update is https://gitlab.com/meltano/sdk/-/blob/241b38e8b6cdfa6f3397d9c70e7b9082b4594554/singer_sdk/helpers/_state.py#L219
visch
04/14/2022, 3:14 PMvisch
04/14/2022, 3:15 PM_sdc_primary_key
?edgar_ramirez_mondragon
04/14/2022, 3:29 PMAre you thinking of having the SDK generateThat is a good option. The SDK already appends context keys in child streams, for example.?_sdc_primary_key
Stéphane Burwash
04/14/2022, 4:02 PMdef parse_response(self, response: requests.Response) -> Iterable[dict]:
"""Parse the response and return an iterator of result rows."""
response.raise_for_status()
input = response.json()
for elem in input["results"]:
elem["id"] = elem["engagement"]["id"]
elem["lastUpdated"] = elem["engagement"]["lastUpdated"]
yield from extract_jsonpath(self.records_jsonpath, input=input)
visch
04/14/2022, 4:04 PM