Skip to content

Commit

Permalink
🐛 Source Sendgrid: add start_time config and correct primary_key (#4682)
Browse files Browse the repository at this point in the history
* add start_time config and correct primary_key

* correct integration tests

* correct type

* config txt and primary_key
  • Loading branch information
marcosmarxm authored Jul 10, 2021
1 parent bba12a9 commit 766ddab
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"sourceDefinitionId": "fbb5fbe2-16ad-4cf4-af7d-ff9d9c316c87",
"name": "Sendgrid",
"dockerRepository": "airbyte/source-sendgrid",
"dockerImageTag": "0.2.4",
"dockerImageTag": "0.2.5",
"documentationUrl": "https://hub.docker.com/r/airbyte/source-sendgrid",
"icon": "sendgrid.svg"
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
- sourceDefinitionId: fbb5fbe2-16ad-4cf4-af7d-ff9d9c316c87
name: Sendgrid
dockerRepository: airbyte/source-sendgrid
dockerImageTag: 0.2.4
dockerImageTag: 0.2.5
documentationUrl: https://hub.docker.com/r/airbyte/source-sendgrid
icon: sendgrid.svg
- sourceDefinitionId: 9e0556f4-69df-4522-a3fb-03264d36b348
Expand Down
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-sendgrid/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ RUN pip install .
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]

LABEL io.airbyte.version=0.2.4
LABEL io.airbyte.version=0.2.5
LABEL io.airbyte.name=airbyte/source-sendgrid
Original file line number Diff line number Diff line change
Expand Up @@ -354,35 +354,6 @@
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "blocks",
"json_schema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"created": {
"type": "integer"
},
"email": {
"type": "string"
},
"reason": {
"type": "string"
},
"status": {
"type": "string"
}
}
},
"supported_sync_modes": ["full_refresh", "incremental"],
"source_defined_cursor": true,
"default_cursor_field": ["created"]
},
"sync_mode": "incremental",
"cursor_field": ["created"],
"destination_sync_mode": "append"
},
{
"stream": {
"name": "bounces",
Expand Down Expand Up @@ -411,32 +382,6 @@
"sync_mode": "incremental",
"cursor_field": ["created"],
"destination_sync_mode": "append"
},
{
"stream": {
"name": "invalid_emails",
"json_schema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"created": {
"type": "integer"
},
"email": {
"type": "string"
},
"reason": {
"type": "string"
}
}
},
"supported_sync_modes": ["full_refresh", "incremental"],
"source_defined_cursor": true,
"default_cursor_field": ["created"]
},
"sync_mode": "incremental",
"cursor_field": ["created"],
"destination_sync_mode": "append"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"type": "string"
},
"alternate_emails": {
"type": "array"
"type": ["null", "array"]
},
"city": {
"type": "string"
Expand All @@ -36,13 +36,13 @@
"type": "string"
},
"list_ids": {
"type": "array"
"type": ["null", "array"]
},
"created_at": {
"type": "array"
"type": "string"
},
"updated_at": {
"type": "array"
"type": "string"
},
"_metadata": {
"type": "object",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "object",
"properties": {
"id": {
"type": "string"
"type": "integer"
},
"name": {
"type": "string"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
"apikey": {
"type": "string",
"description": "API Key, use <a href=\"https://app.sendgrid.com/settings/api_keys/\">admin</a> to generate this key."
},
"start_time": {
"type": "integer",
"description": "Start time in timestamp integer format. Any data before this timestamp will not be replicated.",
"examples": [1558359837]
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ def initial_path() -> str:


class GlobalSuppressions(SendgridStreamOffsetPagination, SendgridStreamIncrementalMixin):
primary_key = "email"

def path(self, **kwargs) -> str:
return "suppression/unsubscribes"

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


class Blocks(SendgridStreamOffsetPagination, SendgridStreamIncrementalMixin):
primary_key = "email"

def path(self, **kwargs) -> str:
return "suppression/blocks"


class Bounces(SendgridStream, SendgridStreamIncrementalMixin):
primary_key = "email"

def path(self, **kwargs) -> str:
return "suppression/bounces"


class InvalidEmails(SendgridStreamOffsetPagination, SendgridStreamIncrementalMixin):
primary_key = "email"

def path(self, **kwargs) -> str:
return "suppression/invalid_emails"


class SpamReports(SendgridStreamOffsetPagination, SendgridStreamIncrementalMixin):
primary_key = "email"

def path(self, **kwargs) -> str:
return "suppression/spam_reports"

0 comments on commit 766ddab

Please sign in to comment.