Skip to content

Commit 9517fae

Browse files
bazarnovOleksandr Bazarnov
andauthored
🎉 Source Shopify - change the default stream cursor_field to 'updated_at' where possible (#4472)
#4472 - Source Shopify - change the default stream cursor_field to 'updated_at' where possible Co-authored-by: Oleksandr Bazarnov <oleksandr.bazarnov@globallogic.com>
1 parent d382d1b commit 9517fae

File tree

10 files changed

+264
-152
lines changed

10 files changed

+264
-152
lines changed

‎airbyte-config/init/src/main/resources/config/STANDARD_SOURCE_DEFINITION/9da77001-af33-4bcd-be46-6252bf9342b9.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"sourceDefinitionId": "9da77001-af33-4bcd-be46-6252bf9342b9",
33
"name": "Shopify",
44
"dockerRepository": "airbyte/source-shopify",
5-
"dockerImageTag": "0.1.8",
5+
"dockerImageTag": "0.1.9",
66
"documentationUrl": "https://docs.airbyte.io/integrations/sources/shopify"
77
}

‎airbyte-config/init/src/main/resources/seed/source_definitions.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
- sourceDefinitionId: 9da77001-af33-4bcd-be46-6252bf9342b9
134134
name: Shopify
135135
dockerRepository: airbyte/source-shopify
136-
dockerImageTag: 0.1.8
136+
dockerImageTag: 0.1.9
137137
documentationUrl: https://docs.airbyte.io/integrations/sources/shopify
138138
- sourceDefinitionId: 9845d17a-45f1-4070-8a60-50914b1c8e2b
139139
name: HTTP Request

‎airbyte-integrations/connectors/source-shopify/Dockerfile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ RUN pip install .
1212
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
1313
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]
1414

15-
LABEL io.airbyte.version=0.1.8
15+
LABEL io.airbyte.version=0.1.9
1616
LABEL io.airbyte.name=airbyte/source-shopify

‎airbyte-integrations/connectors/source-shopify/README.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ You can also build the connector image via Gradle:
7070
```
7171
./gradlew :airbyte-integrations:connectors:source-shopify:airbyteDocker
7272
```
73+
7374
When building via Gradle, the docker image name and tag, respectively, are the values of the `io.airbyte.name` and `io.airbyte.version` `LABEL`s in
7475
the Dockerfile.
7576

@@ -81,12 +82,14 @@ docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-shopify:dev check --co
8182
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-shopify:dev discover --config /secrets/config.json
8283
docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integration_tests airbyte/source-shopify:dev read --config /secrets/config.json --catalog /integration_tests/configured_catalog.json
8384
```
85+
8486
## Testing
8587
Make sure to familiarize yourself with [pytest test discovery](https://docs.pytest.org/en/latest/goodpractices.html#test-discovery) to know how your test files and methods should be named.
8688
First install test dependencies into your virtual environment:
8789
```
8890
pip install .[tests]
8991
```
92+
9093
### Unit Tests
9194
To run unit tests locally, from the connector directory run:
9295
```
@@ -100,6 +103,7 @@ Place custom tests inside `integration_tests/` folder, then, from the connector
100103
```
101104
python3 -m pytest integration_tests
102105
```
106+
103107
#### Acceptance Tests
104108
Customize `acceptance-test-config.yml` file to configure tests. See [Source Acceptance Tests](source-acceptance-tests.md) for more information.
105109
If your connector requires to create or destroy resources for use during acceptance tests create fixtures for it and place them inside integration_tests/acceptance.py.
@@ -115,10 +119,12 @@ To run unit tests:
115119
```
116120
./gradlew :airbyte-integrations:connectors:source-shopify:unitTest
117121
```
122+
118123
To run acceptance and custom integration tests:
119124
```
120125
./gradlew :airbyte-integrations:connectors:source-shopify:integrationTest
121126
```
127+
122128
To build final build the connector:
123129
```
124130
./gradlew :airbyte-integrations:connectors:source-shopify:build
Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
11
{
2+
"customers": {
3+
"updated_at": "2020-06-08T21:09:26-07:00"
4+
},
25
"orders": {
3-
"id": 2497723957406484
6+
"updated_at": "2020-08-03T14:42:06-07:00"
47
},
5-
"collects": {
6-
"id": 1727945110336789
8+
"draft_orders": {
9+
"updated_at": "2020-06-08T21:09:25-07:00"
710
},
811
"products": {
9-
"id": 505931153421589
12+
"updated_at": "2021-06-25T06:13:37-07:00"
1013
},
11-
"customers": {
12-
"id": 366477377551899
14+
"abandoned_checkouts": {
15+
"updated_at": "2021-06-29T02:14:14-07:00"
1316
},
1417
"metafields": {
15-
"id": 1126916852947498
16-
},
17-
"transactions": {
18-
"id": 312557948124698
18+
"updated_at": "2019-11-03T21:15:00-08:00"
1919
},
20-
"order_refunds": {
21-
"id": 63997837325598
20+
"collects": {
21+
"id": 29523654213791
2222
},
2323
"custom_collections": {
24-
"id": 15327628499498
24+
"updated_at": "2021-06-29T09:41:33-07:00"
2525
},
26-
"abandoned_checkouts": {
27-
"id": 142548663666229
26+
"order_refunds": {
27+
"created_at": "2020-02-18T19:49:23-08:00"
2828
},
2929
"order_risks": {
30-
"id": 593300439055898
30+
"id": 5933004390559
31+
},
32+
"transactions": {
33+
"created_at": "2020-06-08T21:09:20-07:00"
3134
},
3235
"pages": {
33-
"id": 131092082366699
36+
"updated_at": "2020-06-01T17:08:25-07:00"
3437
},
3538
"price_rules": {
36-
"id": 935355809987999
39+
"updated_at": "2021-06-29T06:35:08-07:00"
3740
},
3841
"discount_codes": {
39-
"id": 980808098689434
40-
},
41-
"draft_orders": {
42-
"id": 94068132465507
42+
"updated_at": "2021-06-29T06:35:08-07:00"
4343
}
4444
}

‎airbyte-integrations/connectors/source-shopify/integration_tests/configured_catalog.json‎

Lines changed: 61 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,10 @@
201201
},
202202
"supported_sync_modes": ["incremental", "full_refresh"],
203203
"source_defined_cursor": true,
204-
"default_cursor_field": ["id"]
204+
"default_cursor_field": ["updated_at"]
205205
},
206206
"sync_mode": "incremental",
207-
"cursor_field": ["id"],
207+
"cursor_field": ["updated_at"],
208208
"destination_sync_mode": "append"
209209
},
210210
{
@@ -1638,10 +1638,10 @@
16381638
},
16391639
"supported_sync_modes": ["incremental", "full_refresh"],
16401640
"source_defined_cursor": true,
1641-
"default_cursor_field": ["id"]
1641+
"default_cursor_field": ["updated_at"]
16421642
},
16431643
"sync_mode": "incremental",
1644-
"cursor_field": ["id"],
1644+
"cursor_field": ["updated_at"],
16451645
"destination_sync_mode": "append"
16461646
},
16471647
{
@@ -2335,10 +2335,10 @@
23352335
},
23362336
"supported_sync_modes": ["incremental", "full_refresh"],
23372337
"source_defined_cursor": true,
2338-
"default_cursor_field": ["id"]
2338+
"default_cursor_field": ["updated_at"]
23392339
},
23402340
"sync_mode": "incremental",
2341-
"cursor_field": ["id"],
2341+
"cursor_field": ["updated_at"],
23422342
"destination_sync_mode": "append"
23432343
},
23442344
{
@@ -2592,10 +2592,10 @@
25922592
},
25932593
"supported_sync_modes": ["incremental", "full_refresh"],
25942594
"source_defined_cursor": true,
2595-
"default_cursor_field": ["id"]
2595+
"default_cursor_field": ["updated_at"]
25962596
},
25972597
"sync_mode": "incremental",
2598-
"cursor_field": ["id"],
2598+
"cursor_field": ["updated_at"],
25992599
"destination_sync_mode": "append"
26002600
},
26012601
{
@@ -3373,10 +3373,10 @@
33733373
},
33743374
"supported_sync_modes": ["incremental", "full_refresh"],
33753375
"source_defined_cursor": true,
3376-
"default_cursor_field": ["id"]
3376+
"default_cursor_field": ["updated_at"]
33773377
},
33783378
"sync_mode": "incremental",
3379-
"cursor_field": ["id"],
3379+
"cursor_field": ["updated_at"],
33803380
"destination_sync_mode": "append"
33813381
},
33823382
{
@@ -3425,6 +3425,45 @@
34253425
},
34263426
"supported_sync_modes": ["incremental", "full_refresh"],
34273427
"source_defined_cursor": true,
3428+
"default_cursor_field": ["updated_at"]
3429+
},
3430+
"sync_mode": "incremental",
3431+
"cursor_field": ["updated_at"],
3432+
"destination_sync_mode": "append"
3433+
},
3434+
{
3435+
"stream": {
3436+
"name": "collects",
3437+
"json_schema": {
3438+
"type": "object",
3439+
"properties": {
3440+
"id": {
3441+
"type": ["null", "integer"]
3442+
},
3443+
"collection_id": {
3444+
"type": ["null", "integer"]
3445+
},
3446+
"created_at": {
3447+
"type": ["null", "string"],
3448+
"format": "date-time"
3449+
},
3450+
"position": {
3451+
"type": ["null", "integer"]
3452+
},
3453+
"product_id": {
3454+
"type": ["null", "integer"]
3455+
},
3456+
"sort_value": {
3457+
"type": ["null", "string"]
3458+
},
3459+
"updated_at": {
3460+
"type": ["null", "string"],
3461+
"format": "date-time"
3462+
}
3463+
}
3464+
},
3465+
"supported_sync_modes": ["incremental", "full_refresh"],
3466+
"source_defined_cursor": true,
34283467
"default_cursor_field": ["id"]
34293468
},
34303469
"sync_mode": "incremental",
@@ -3491,10 +3530,10 @@
34913530
},
34923531
"supported_sync_modes": ["incremental", "full_refresh"],
34933532
"source_defined_cursor": true,
3494-
"default_cursor_field": ["id"]
3533+
"default_cursor_field": ["updated_at"]
34953534
},
34963535
"sync_mode": "incremental",
3497-
"cursor_field": ["id"],
3536+
"cursor_field": ["updated_at"],
34983537
"destination_sync_mode": "append"
34993538
},
35003539
{
@@ -3897,10 +3936,10 @@
38973936
},
38983937
"supported_sync_modes": ["incremental", "full_refresh"],
38993938
"source_defined_cursor": true,
3900-
"default_cursor_field": ["id"]
3939+
"default_cursor_field": ["created_at"]
39013940
},
39023941
"sync_mode": "incremental",
3903-
"cursor_field": ["id"],
3942+
"cursor_field": ["created_at"],
39043943
"destination_sync_mode": "append"
39053944
},
39063945
{
@@ -4054,10 +4093,10 @@
40544093
},
40554094
"supported_sync_modes": ["incremental", "full_refresh"],
40564095
"source_defined_cursor": true,
4057-
"default_cursor_field": ["id"]
4096+
"default_cursor_field": ["created_at"]
40584097
},
40594098
"sync_mode": "incremental",
4060-
"cursor_field": ["id"],
4099+
"cursor_field": ["created_at"],
40614100
"destination_sync_mode": "append"
40624101
},
40634102
{
@@ -4103,10 +4142,10 @@
41034142
},
41044143
"supported_sync_modes": ["full_refresh", "incremental"],
41054144
"source_defined_cursor": true,
4106-
"default_cursor_field": ["id"]
4145+
"default_cursor_field": ["updated_at"]
41074146
},
41084147
"sync_mode": "incremental",
4109-
"cursor_field": ["id"],
4148+
"cursor_field": ["updated_at"],
41104149
"destination_sync_mode": "append"
41114150
},
41124151
{
@@ -4265,10 +4304,10 @@
42654304
},
42664305
"supported_sync_modes": ["full_refresh", "incremental"],
42674306
"source_defined_cursor": true,
4268-
"default_cursor_field": ["id"]
4307+
"default_cursor_field": ["updated_at"]
42694308
},
42704309
"sync_mode": "incremental",
4271-
"cursor_field": ["id"],
4310+
"cursor_field": ["updated_at"],
42724311
"destination_sync_mode": "append"
42734312
},
42744313
{
@@ -4301,10 +4340,10 @@
43014340
},
43024341
"supported_sync_modes": ["full_refresh", "incremental"],
43034342
"source_defined_cursor": true,
4304-
"default_cursor_field": ["id"]
4343+
"default_cursor_field": ["updated_at"]
43054344
},
43064345
"sync_mode": "incremental",
4307-
"cursor_field": ["id"],
4346+
"cursor_field": ["updated_at"],
43084347
"destination_sync_mode": "append"
43094348
}
43104349
]

‎airbyte-integrations/connectors/source-shopify/integration_tests/no_refunds_catalog.json‎

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2490,10 +2490,10 @@
24902490
},
24912491
"supported_sync_modes": ["incremental", "full_refresh"],
24922492
"source_defined_cursor": true,
2493-
"default_cursor_field": ["id"]
2493+
"default_cursor_field": ["updated_at"]
24942494
},
24952495
"sync_mode": "incremental",
2496-
"cursor_field": ["id"],
2496+
"cursor_field": ["updated_at"],
24972497
"destination_sync_mode": "append"
24982498
},
24992499
{
@@ -3586,6 +3586,45 @@
35863586
"cursor_field": ["id"],
35873587
"destination_sync_mode": "append"
35883588
},
3589+
{
3590+
"stream": {
3591+
"name": "collects",
3592+
"json_schema": {
3593+
"type": "object",
3594+
"properties": {
3595+
"id": {
3596+
"type": ["null", "integer"]
3597+
},
3598+
"collection_id": {
3599+
"type": ["null", "integer"]
3600+
},
3601+
"created_at": {
3602+
"type": ["null", "string"],
3603+
"format": "date-time"
3604+
},
3605+
"position": {
3606+
"type": ["null", "integer"]
3607+
},
3608+
"product_id": {
3609+
"type": ["null", "integer"]
3610+
},
3611+
"sort_value": {
3612+
"type": ["null", "string"]
3613+
},
3614+
"updated_at": {
3615+
"type": ["null", "string"],
3616+
"format": "date-time"
3617+
}
3618+
}
3619+
},
3620+
"supported_sync_modes": ["incremental", "full_refresh"],
3621+
"source_defined_cursor": true,
3622+
"default_cursor_field": ["id"]
3623+
},
3624+
"sync_mode": "incremental",
3625+
"cursor_field": ["id"],
3626+
"destination_sync_mode": "append"
3627+
},
35893628
{
35903629
"stream": {
35913630
"name": "custom_collections",

0 commit comments

Comments
 (0)