Skip to content

Commit 766ddab

Browse files
authored
🐛 Source Sendgrid: add start_time config and correct primary_key (#4682)
* add start_time config and correct primary_key * correct integration tests * correct type * config txt and primary_key
1 parent bba12a9 commit 766ddab

File tree

8 files changed

+23
-63
lines changed

8 files changed

+23
-63
lines changed

airbyte-config/init/src/main/resources/config/STANDARD_SOURCE_DEFINITION/fbb5fbe2-16ad-4cf4-af7d-ff9d9c316c87.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"sourceDefinitionId": "fbb5fbe2-16ad-4cf4-af7d-ff9d9c316c87",
33
"name": "Sendgrid",
44
"dockerRepository": "airbyte/source-sendgrid",
5-
"dockerImageTag": "0.2.4",
5+
"dockerImageTag": "0.2.5",
66
"documentationUrl": "https://hub.docker.com/r/airbyte/source-sendgrid",
77
"icon": "sendgrid.svg"
88
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
- sourceDefinitionId: fbb5fbe2-16ad-4cf4-af7d-ff9d9c316c87
6969
name: Sendgrid
7070
dockerRepository: airbyte/source-sendgrid
71-
dockerImageTag: 0.2.4
71+
dockerImageTag: 0.2.5
7272
documentationUrl: https://hub.docker.com/r/airbyte/source-sendgrid
7373
icon: sendgrid.svg
7474
- sourceDefinitionId: 9e0556f4-69df-4522-a3fb-03264d36b348

airbyte-integrations/connectors/source-sendgrid/Dockerfile

+1-1
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.2.4
15+
LABEL io.airbyte.version=0.2.5
1616
LABEL io.airbyte.name=airbyte/source-sendgrid

airbyte-integrations/connectors/source-sendgrid/sample_files/no_spam_reports_configured_catalog.json

-55
Original file line numberDiff line numberDiff line change
@@ -354,35 +354,6 @@
354354
"sync_mode": "full_refresh",
355355
"destination_sync_mode": "overwrite"
356356
},
357-
{
358-
"stream": {
359-
"name": "blocks",
360-
"json_schema": {
361-
"$schema": "http://json-schema.org/draft-07/schema#",
362-
"type": "object",
363-
"properties": {
364-
"created": {
365-
"type": "integer"
366-
},
367-
"email": {
368-
"type": "string"
369-
},
370-
"reason": {
371-
"type": "string"
372-
},
373-
"status": {
374-
"type": "string"
375-
}
376-
}
377-
},
378-
"supported_sync_modes": ["full_refresh", "incremental"],
379-
"source_defined_cursor": true,
380-
"default_cursor_field": ["created"]
381-
},
382-
"sync_mode": "incremental",
383-
"cursor_field": ["created"],
384-
"destination_sync_mode": "append"
385-
},
386357
{
387358
"stream": {
388359
"name": "bounces",
@@ -411,32 +382,6 @@
411382
"sync_mode": "incremental",
412383
"cursor_field": ["created"],
413384
"destination_sync_mode": "append"
414-
},
415-
{
416-
"stream": {
417-
"name": "invalid_emails",
418-
"json_schema": {
419-
"$schema": "http://json-schema.org/draft-07/schema#",
420-
"type": "object",
421-
"properties": {
422-
"created": {
423-
"type": "integer"
424-
},
425-
"email": {
426-
"type": "string"
427-
},
428-
"reason": {
429-
"type": "string"
430-
}
431-
}
432-
},
433-
"supported_sync_modes": ["full_refresh", "incremental"],
434-
"source_defined_cursor": true,
435-
"default_cursor_field": ["created"]
436-
},
437-
"sync_mode": "incremental",
438-
"cursor_field": ["created"],
439-
"destination_sync_mode": "append"
440385
}
441386
]
442387
}

airbyte-integrations/connectors/source-sendgrid/source_sendgrid/schemas/contacts.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"type": "string"
1010
},
1111
"alternate_emails": {
12-
"type": "array"
12+
"type": ["null", "array"]
1313
},
1414
"city": {
1515
"type": "string"
@@ -36,13 +36,13 @@
3636
"type": "string"
3737
},
3838
"list_ids": {
39-
"type": "array"
39+
"type": ["null", "array"]
4040
},
4141
"created_at": {
42-
"type": "array"
42+
"type": "string"
4343
},
4444
"updated_at": {
45-
"type": "array"
45+
"type": "string"
4646
},
4747
"_metadata": {
4848
"type": "object",

airbyte-integrations/connectors/source-sendgrid/source_sendgrid/schemas/suppression_groups.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"type": "object",
44
"properties": {
55
"id": {
6-
"type": "string"
6+
"type": "integer"
77
},
88
"name": {
99
"type": "string"

airbyte-integrations/connectors/source-sendgrid/source_sendgrid/spec.json

+5
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
"apikey": {
1111
"type": "string",
1212
"description": "API Key, use <a href=\"https://app.sendgrid.com/settings/api_keys/\">admin</a> to generate this key."
13+
},
14+
"start_time": {
15+
"type": "integer",
16+
"description": "Start time in timestamp integer format. Any data before this timestamp will not be replicated.",
17+
"examples": [1558359837]
1318
}
1419
}
1520
}

airbyte-integrations/connectors/source-sendgrid/source_sendgrid/streams.py

+10
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@ def initial_path() -> str:
190190

191191

192192
class GlobalSuppressions(SendgridStreamOffsetPagination, SendgridStreamIncrementalMixin):
193+
primary_key = "email"
194+
193195
def path(self, **kwargs) -> str:
194196
return "suppression/unsubscribes"
195197

@@ -205,20 +207,28 @@ def path(self, **kwargs) -> str:
205207

206208

207209
class Blocks(SendgridStreamOffsetPagination, SendgridStreamIncrementalMixin):
210+
primary_key = "email"
211+
208212
def path(self, **kwargs) -> str:
209213
return "suppression/blocks"
210214

211215

212216
class Bounces(SendgridStream, SendgridStreamIncrementalMixin):
217+
primary_key = "email"
218+
213219
def path(self, **kwargs) -> str:
214220
return "suppression/bounces"
215221

216222

217223
class InvalidEmails(SendgridStreamOffsetPagination, SendgridStreamIncrementalMixin):
224+
primary_key = "email"
225+
218226
def path(self, **kwargs) -> str:
219227
return "suppression/invalid_emails"
220228

221229

222230
class SpamReports(SendgridStreamOffsetPagination, SendgridStreamIncrementalMixin):
231+
primary_key = "email"
232+
223233
def path(self, **kwargs) -> str:
224234
return "suppression/spam_reports"

0 commit comments

Comments
 (0)