Skip to content

Commit

Permalink
fix discovery for freshdesk (#3591)
Browse files Browse the repository at this point in the history
* fix discovery for freshdesk

* bump version && merge

* create changelog
  • Loading branch information
vovavovavovavova committed May 25, 2021
1 parent 374f63f commit 9e20303
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"sourceDefinitionId": "ec4b9503-13cb-48ab-a4ab-6ade4be46567",
"name": "Freshdesk",
"dockerRepository": "airbyte/source-freshdesk",
"dockerImageTag": "0.2.2",
"dockerImageTag": "0.2.3",
"documentationUrl": "https://hub.docker.com/r/airbyte/source-freshdesk",
"icon": "freshdesk.svg"
}
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
- sourceDefinitionId: ec4b9503-13cb-48ab-a4ab-6ade4be46567
name: Freshdesk
dockerRepository: airbyte/source-freshdesk
dockerImageTag: 0.2.2
dockerImageTag: 0.2.3
documentationUrl: https://hub.docker.com/r/airbyte/source-freshdesk
icon: freshdesk.svg
- sourceDefinitionId: 396e4ca3-8a97-4b85-aa4e-c9d8c2d5f992
Expand Down
4 changes: 4 additions & 0 deletions airbyte-integrations/connectors/source-freshdesk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Changelog

## 0.2.3
Fix discovery and set default cursor field as "updated_at"
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ COPY $CODE_PATH ./$CODE_PATH
COPY setup.py ./
RUN pip install .

LABEL io.airbyte.version=0.2.2
LABEL io.airbyte.version=0.2.3
LABEL io.airbyte.name=airbyte/source-freshdesk
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
#


from typing import Any, Mapping, Tuple
from typing import Any, Iterable, Mapping, Tuple

from airbyte_protocol import AirbyteStream
from base_python import BaseClient

from .api import (
Expand Down Expand Up @@ -64,6 +65,14 @@ def __init__(self, domain, api_key, requests_per_minute: int = None):
}
super().__init__()

@property
def streams(self) -> Iterable[AirbyteStream]:
"""List of available streams"""
for stream in super().streams:
if stream.source_defined_cursor:
stream.default_cursor_field = [self._apis[stream.name].state_pk]
yield stream

def settings(self):
url = "settings/helpdesk"
return self._api.get(url)
Expand Down

0 comments on commit 9e20303

Please sign in to comment.