Skip to content

Commit ce85afe

Browse files
author
Anton Karpets
authored
🎉Source Klaviyo: migrate to low-code (#36264)
1 parent 3ed543b commit ce85afe

File tree

14 files changed

+541
-462
lines changed

14 files changed

+541
-462
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[run]
2+
omit =
3+
source_klaviyo/run.py

airbyte-integrations/connectors/source-klaviyo/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ See `sample_files/sample_config.json` for a sample config file.
3030
poetry run source-klaviyo spec
3131
poetry run source-klaviyo check --config secrets/config.json
3232
poetry run source-klaviyo discover --config secrets/config.json
33-
poetry run source-klaviyo read --config secrets/config.json --catalog sample_files/configured_catalog.json
33+
poetry run source-klaviyo read --config secrets/config.json --catalog integration_tests/configured_catalog.json
3434
```
3535

3636
### Running unit tests

airbyte-integrations/connectors/source-klaviyo/integration_tests/abnormal_state.json

+46-18
Original file line numberDiff line numberDiff line change
@@ -2,67 +2,95 @@
22
{
33
"type": "STREAM",
44
"stream": {
5-
"stream_state": { "datetime": "2120-10-10T00:00:00Z" },
6-
"stream_descriptor": { "name": "events" }
5+
"stream_state": {
6+
"datetime": "2120-10-10 00:00:00+00:00"
7+
},
8+
"stream_descriptor": {
9+
"name": "events"
10+
}
711
}
812
},
913
{
1014
"type": "STREAM",
1115
"stream": {
12-
"stream_state": { "updated": "2120-10-10T00:00:00Z" },
13-
"stream_descriptor": { "name": "global_exclusions" }
16+
"stream_state": {
17+
"updated": "2120-10-10T00:00:00+00:00"
18+
},
19+
"stream_descriptor": {
20+
"name": "global_exclusions"
21+
}
1422
}
1523
},
1624
{
1725
"type": "STREAM",
1826
"stream": {
1927
"stream_state": {
20-
"updated": "2120-10-10 00:00:00",
28+
"updated": "2120-10-10T00:00:00+00:00",
2129
"archived": {
22-
"updated": "2120-10-10 00:00:00"
30+
"updated": "2120-10-10T00:00:00+00:00"
2331
}
2432
},
25-
"stream_descriptor": { "name": "flows" }
33+
"stream_descriptor": {
34+
"name": "flows"
35+
}
2636
}
2737
},
2838
{
2939
"type": "STREAM",
3040
"stream": {
31-
"stream_state": { "updated": "2120-10-10 00:00:00" },
32-
"stream_descriptor": { "name": "metrics" }
41+
"stream_state": {
42+
"updated": "2120-10-10T00:00:00+00:00"
43+
},
44+
"stream_descriptor": {
45+
"name": "metrics"
46+
}
3347
}
3448
},
3549
{
3650
"type": "STREAM",
3751
"stream": {
38-
"stream_state": { "updated": "2120-10-10 00:00:00" },
39-
"stream_descriptor": { "name": "lists" }
52+
"stream_state": {
53+
"updated": "2120-10-10T00:00:00+00:00"
54+
},
55+
"stream_descriptor": {
56+
"name": "lists"
57+
}
4058
}
4159
},
4260
{
4361
"type": "STREAM",
4462
"stream": {
4563
"stream_state": {
46-
"updated_at": "2120-10-10 00:00:00",
64+
"updated_at": "2120-10-10T00:00:00+00:00",
4765
"archived": {
48-
"updated_at": "2120-10-10 00:00:00"
66+
"updated_at": "2120-10-10T00:00:00+00:00"
4967
}
5068
},
51-
"stream_descriptor": { "name": "campaigns" }
69+
"stream_descriptor": {
70+
"name": "campaigns"
71+
}
5272
}
5373
},
5474
{
5575
"type": "STREAM",
5676
"stream": {
57-
"stream_state": { "updated": "2120-10-10 00:00:00" },
58-
"stream_descriptor": { "name": "profiles" }
77+
"stream_state": {
78+
"updated": "2120-10-10T00:00:00+00:00"
79+
},
80+
"stream_descriptor": {
81+
"name": "profiles"
82+
}
5983
}
6084
},
6185
{
6286
"type": "STREAM",
6387
"stream": {
64-
"stream_state": { "updated": "2120-10-10 00:00:00" },
65-
"stream_descriptor": { "name": "email_templates" }
88+
"stream_state": {
89+
"updated": "2120-10-10T00:00:00+00:00"
90+
},
91+
"stream_descriptor": {
92+
"name": "email_templates"
93+
}
6694
}
6795
}
6896
]

airbyte-integrations/connectors/source-klaviyo/integration_tests/configured_catalog.json

+32-32
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
"stream": {
55
"name": "campaigns",
66
"json_schema": {},
7-
"supported_sync_modes": ["full_refresh"],
8-
"source_defined_cursor": null,
9-
"default_cursor_field": null,
7+
"supported_sync_modes": ["full_refresh", "incremental"],
8+
"source_defined_cursor": true,
9+
"default_cursor_field": ["updated_at"],
1010
"source_defined_primary_key": [["id"]],
1111
"namespace": null
1212
},
13-
"sync_mode": "full_refresh",
14-
"cursor_field": null,
13+
"sync_mode": "incremental",
14+
"cursor_field": ["updated_at"],
1515
"destination_sync_mode": "append",
1616
"primary_key": [["id"]]
1717
},
@@ -25,7 +25,7 @@
2525
"source_defined_primary_key": [["id"]],
2626
"namespace": null
2727
},
28-
"sync_mode": "full_refresh",
28+
"sync_mode": "incremental",
2929
"cursor_field": ["updated"],
3030
"destination_sync_mode": "append",
3131
"primary_key": [["id"]]
@@ -36,11 +36,11 @@
3636
"json_schema": {},
3737
"supported_sync_modes": ["full_refresh", "incremental"],
3838
"source_defined_cursor": true,
39-
"default_cursor_field": ["timestamp"],
39+
"default_cursor_field": ["datetime"],
4040
"source_defined_primary_key": [["id"]],
4141
"namespace": null
4242
},
43-
"sync_mode": "full_refresh",
43+
"sync_mode": "incremental",
4444
"cursor_field": ["datetime"],
4545
"destination_sync_mode": "append",
4646
"primary_key": [["id"]]
@@ -49,29 +49,29 @@
4949
"stream": {
5050
"name": "global_exclusions",
5151
"json_schema": {},
52-
"supported_sync_modes": ["full_refresh"],
53-
"source_defined_cursor": null,
54-
"default_cursor_field": null,
52+
"supported_sync_modes": ["full_refresh", "incremental"],
53+
"source_defined_cursor": true,
54+
"default_cursor_field": ["updated"],
5555
"source_defined_primary_key": [["id"]],
5656
"namespace": null
5757
},
58-
"sync_mode": "full_refresh",
59-
"cursor_field": null,
58+
"sync_mode": "incremental",
59+
"cursor_field": ["updated"],
6060
"destination_sync_mode": "append",
6161
"primary_key": [["id"]]
6262
},
6363
{
6464
"stream": {
6565
"name": "lists",
6666
"json_schema": {},
67-
"supported_sync_modes": ["full_refresh"],
68-
"source_defined_cursor": null,
69-
"default_cursor_field": null,
67+
"supported_sync_modes": ["full_refresh", "incremental"],
68+
"source_defined_cursor": true,
69+
"default_cursor_field": ["updated"],
7070
"source_defined_primary_key": [["id"]],
7171
"namespace": null
7272
},
73-
"sync_mode": "full_refresh",
74-
"cursor_field": null,
73+
"sync_mode": "incremental",
74+
"cursor_field": ["updated"],
7575
"destination_sync_mode": "append",
7676
"primary_key": [["id"]]
7777
},
@@ -80,43 +80,43 @@
8080
"name": "flows",
8181
"json_schema": {},
8282
"supported_sync_modes": ["full_refresh", "incremental"],
83-
"source_defined_cursor": null,
84-
"default_cursor_field": null,
83+
"source_defined_cursor": true,
84+
"default_cursor_field": ["updated"],
8585
"source_defined_primary_key": [["id"]],
8686
"namespace": null
8787
},
88-
"sync_mode": "full_refresh",
89-
"cursor_field": null,
88+
"sync_mode": "incremental",
89+
"cursor_field": ["updated"],
9090
"destination_sync_mode": "append",
9191
"primary_key": [["id"]]
9292
},
9393
{
9494
"stream": {
9595
"name": "metrics",
9696
"json_schema": {},
97-
"supported_sync_modes": ["full_refresh"],
98-
"source_defined_cursor": null,
99-
"default_cursor_field": null,
97+
"supported_sync_modes": ["full_refresh", "incremental"],
98+
"source_defined_cursor": true,
99+
"default_cursor_field": ["updated"],
100100
"source_defined_primary_key": [["id"]],
101101
"namespace": null
102102
},
103-
"sync_mode": "full_refresh",
104-
"cursor_field": null,
103+
"sync_mode": "incremental",
104+
"cursor_field": ["updated"],
105105
"destination_sync_mode": "append",
106106
"primary_key": [["id"]]
107107
},
108108
{
109109
"stream": {
110110
"name": "email_templates",
111111
"json_schema": {},
112-
"supported_sync_modes": ["full_refresh"],
113-
"source_defined_cursor": null,
114-
"default_cursor_field": null,
112+
"supported_sync_modes": ["full_refresh", "incremental"],
113+
"source_defined_cursor": true,
114+
"default_cursor_field": ["updated"],
115115
"source_defined_primary_key": [["id"]],
116116
"namespace": null
117117
},
118-
"sync_mode": "full_refresh",
119-
"cursor_field": null,
118+
"sync_mode": "incremental",
119+
"cursor_field": ["updated"],
120120
"destination_sync_mode": "append",
121121
"primary_key": [["id"]]
122122
}

airbyte-integrations/connectors/source-klaviyo/metadata.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ data:
88
definitionId: 95e8cffd-b8c4-4039-968e-d32fb4a69bde
99
connectorBuildOptions:
1010
baseImage: docker.io/airbyte/python-connector-base:1.2.0@sha256:c22a9d97464b69d6ef01898edf3f8612dc11614f05a84984451dde195f337db9
11-
dockerImageTag: 2.4.0
11+
dockerImageTag: 2.5.0
1212
dockerRepository: airbyte/source-klaviyo
1313
githubIssueLabel: source-klaviyo
1414
icon: klaviyo.svg
@@ -34,16 +34,16 @@ data:
3434
- flows
3535
releases:
3636
breakingChanges:
37-
1.0.0:
38-
message: In this release, for 'events' stream changed type of 'event_properties/items/quantity' field from integer to number. Users will need to refresh the source schema and reset events streams after upgrading.
39-
upgradeDeadline: "2023-11-30"
4037
2.0.0:
4138
message: In this release, streams 'campaigns', 'email_templates', 'events', 'flows', 'global_exclusions', 'lists', and 'metrics' are now pulling data using latest API which has a different schema. Users will need to refresh the source schemas and reset these streams after upgrading.
4239
upgradeDeadline: "2023-11-30"
40+
1.0.0:
41+
message: In this release, for 'events' stream changed type of 'event_properties/items/quantity' field from integer to number. Users will need to refresh the source schema and reset events streams after upgrading.
42+
upgradeDeadline: "2023-11-30"
4343
documentationUrl: https://docs.airbyte.com/integrations/sources/klaviyo
4444
tags:
4545
- language:python
46-
- cdk:python
46+
- cdk:low-code
4747
ab_internal:
4848
sl: 200
4949
ql: 400

0 commit comments

Comments
 (0)