Rachel RIZK
11/07/2022, 4:38 PMincrement - append
data instead of full refresh - overwrite/append
with the low-code CDK.
Here's how the data is structured:
testdata = {
'rows': [
{
'data_row1': [{ 'kpi': 2, 'date': "2022-11-07" }],
'metadata_row1': {'id': 1}
},
{
'data_row2': [{ 'kpi': 8, 'date': "2022-11-07" }],
'metadata_row2': {'id': 2}
},
]
}
• To get all rows, I need to set record_selector
on rows
field
• But to get the date field (enabling increment with slicing) I need to set the cursor_field
to something like that: ["data_row1", "0", "date"]
or data_row1[0]['date']
.
◦ With 1st solution, I have an error because it won't accept a list
◦ With 2nd solution, the script runs but the cursor is not working and displays older data than what's in sample_state.json
I'm wondering, is there actually a way to activate increment on this kind of data?
It's the last step before I can contribute for a new connector 🙏Rachel RIZK
11/07/2022, 4:42 PMrecord_selector: ["rows", "0", "data_row1"]
+ cursor_field: "date"
and it worked well, but it's not correct as I'm only getting the first row for each call.
It's when I am nesting the cursor_field that it's simply not working anymore 😕Brian Lai (Airbyte)
11/09/2022, 10:50 PMBrian Lai (Airbyte)
11/09/2022, 10:53 PMdata_row1
or data_row2
?Rachel RIZK
11/10/2022, 6:44 PMRachel RIZK
11/10/2022, 6:46 PMdata_row
for each row itemRachel RIZK
11/10/2022, 6:50 PMpath: ['date']
value: ' {{ stream_slice['end_time'] }}'
then I was able to call 'date'
in cursor field, which was finally stored in state 🥳Rachel RIZK
11/10/2022, 6:51 PMBrian Lai (Airbyte)
11/11/2022, 3:22 AM