Skip to content

Commit

Permalink
Source FreshCaller: fix spec type check (airbytehq#26065)
Browse files Browse the repository at this point in the history
* Source FreshCaller: fix spec type check

* Source FreshCaller: update docs

* Source FreshCaller: fix schemas

* Source FreshCaller: reformat

* Source FreshCaller: bump version minor

* Source FreshCaller: update metadata
  • Loading branch information
artem1205 authored and marcosmarxm committed Jun 8, 2023
1 parent 41e3c7e commit 603cf09
Show file tree
Hide file tree
Showing 11 changed files with 39 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ COPY source_freshcaller ./source_freshcaller
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]

LABEL io.airbyte.version=0.1.0
LABEL io.airbyte.version=0.2.0
LABEL io.airbyte.name=airbyte/source-freshcaller
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ connector_image: airbyte/source-freshcaller:dev
tests:
spec:
- spec_path: "source_freshcaller/spec.json"
backward_compatibility_tests_config:
disable_for_version: 0.1.0 # Fix start_date type
connection:
- config_path: "secrets/config.json"
status: "succeed"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ data:
connectorSubtype: api
connectorType: source
definitionId: 8a5d48f6-03bb-4038-a942-a8d3f175cca3
dockerImageTag: 0.1.0
dockerImageTag: 0.2.0
dockerRepository: airbyte/source-freshcaller
githubIssueLabel: source-freshcaller
icon: freshcaller.svg
Expand Down
3 changes: 1 addition & 2 deletions airbyte-integrations/connectors/source-freshcaller/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
from setuptools import find_packages, setup

MAIN_REQUIREMENTS = [
"airbyte-cdk~=0.1",
"pendulum==1.2.0",
"airbyte-cdk~=0.2",
]

TEST_REQUIREMENTS = [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"$schema": "https://json-schema.org/draft-07/schema#",
"type": "object",
"additionalProperties": true,
"properties": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"$schema": "https://json-schema.org/draft-07/schema#",
"type": "object",
"additionalProperties": true,
"properties": {
Expand Down Expand Up @@ -99,8 +99,25 @@
},
"type": ["object", "null"]
},

"recording_to_redact": {
"type": ["object", "null"],
"properties": {
"id": {
"type": ["integer", "null"]
},
"url": {
"type": ["string", "null"]
},
"duration": {
"type": ["number", "null"]
},
"duration_unit": {
"type": ["string", "null"]
}
}
},
"participants": {
"type": ["array", "null"],
"items": {
"properties": {
"id": {
Expand Down Expand Up @@ -155,7 +172,9 @@
}
},
"type": "object"
},
}
},
"parallel_call_groups": {
"type": ["array", "null"]
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"$schema": "https://json-schema.org/draft-07/schema#",
"type": "object",
"additionalProperties": true,
"properties": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"$schema": "https://json-schema.org/draft-07/schema#",
"type": "object",
"additionalProperties": true,
"properties": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"documentationUrl": "https://docs.airbyte.com/integrations/sources/freshcaller",
"connectionSpecification": {
"$schema": "http://json-schema.org/draft-07/schema#",
"$schema": "https://json-schema.org/draft-07/schema#",
"title": "Freshcaller Spec",
"type": "object",
"required": ["domain", "api_key", "start_date"],
Expand All @@ -28,6 +28,7 @@
"title": "Start Date",
"description": "UTC date and time. Any data created after this date will be replicated.",
"format": "date-time",
"type": "string",
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$",
"examples": ["2022-01-01T12:00:00Z"]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,15 @@ def stream_slices(self, stream_state: Mapping[str, Any] = None, **kwargs) -> Ite
...]
"""
start_date = pendulum.parse(self.start_date).in_timezone("UTC")
end_date = pendulum.utcnow().subtract(minutes=self.sync_lag_minutes) # have a safe lag
end_date = pendulum.now("UTC").subtract(minutes=self.sync_lag_minutes) # have a safe lag

# Determine stream_state, if no stream_state we use start_date
if stream_state:
start_date = stream_state.get(self.cursor_field)
start_date = pendulum.parse(start_date) if isinstance(start_date, str) else start_date
start_date = start_date.in_tz("UTC")
# use the lowest date between start_date and self.end_date, otherwise API fails if start_date is in future
start_date: pendulum.Pendulum = min(start_date, end_date)
start_date: pendulum.DateTime = min(start_date, end_date)
date_slices = []

while start_date <= end_date:
Expand Down
6 changes: 5 additions & 1 deletion docs/integrations/sources/freshcaller.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,8 @@ The Freshcaller connector should not run into Freshcaller API limitations under
Please read [How to find your API key](https://support.freshdesk.com/en/support/solutions/articles/225435-where-can-i-find-my-api-key-).

## Changelog
| 0.1.0 | 2022-08-11 | [14759](https://github.com/airbytehq/airbyte/pull/14759) | 🎉 New Source: Freshcaller |

| Version | Date | Pull Request | Subject |
|:--------|:-----------|:---------------------------------------------------------|:-------------------------------------|
| 0.2.0 | 2023-05-15 | [26065](https://github.com/airbytehq/airbyte/pull/26065) | Fix spec type check for `start_date` |
| 0.1.0 | 2022-08-11 | [14759](https://github.com/airbytehq/airbyte/pull/14759) | 🎉 New Source: Freshcaller |

0 comments on commit 603cf09

Please sign in to comment.