Skip to content

Commit

Permalink
HTTP sources fail to sync (HTTP GET Request) #2910 (#3008)
Browse files Browse the repository at this point in the history
* support array of objects

* fixup

* make it dry

* bump zoom source version
  • Loading branch information
vovavovavovavova committed Apr 30, 2021
1 parent 237b99e commit 3569b68
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"sourceDefinitionId": "aea2fd0d-377d-465e-86c0-4fdc4f688e51",
"name": "Zoom",
"dockerRepository": "airbyte/source-zoom-singer",
"dockerImageTag": "0.2.1",
"dockerImageTag": "0.2.2",
"documentationUrl": "https://hub.docker.com/r/airbyte/source-zoom-singer",
"icon": "zoom.svg"
}
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
- sourceDefinitionId: aea2fd0d-377d-465e-86c0-4fdc4f688e51
name: Zoom
dockerRepository: airbyte/source-zoom-singer
dockerImageTag: 0.2.1
dockerImageTag: 0.2.2
documentationUrl: https://hub.docker.com/r/airbyte/source-zoom-singer
icon: zoom.svg
- sourceDefinitionId: eaf50f04-21dd-4620-913b-2a83f5635227
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,17 @@ def read(
raise Exception(f"Request failed. {r.text}")

# need to eagerly fetch the json.
message = AirbyteMessage(
type=Type.RECORD,
record=AirbyteRecordMessage(
stream=SourceHttpRequest.STREAM_NAME, data=r.json(), emitted_at=int(datetime.now().timestamp()) * 1000
),
)
data = r.json()
if not isinstance(data, list):
data = [data]

return (m for m in [message])
for record in data:
yield AirbyteMessage(
type=Type.RECORD,
record=AirbyteRecordMessage(
stream=SourceHttpRequest.STREAM_NAME, data=record, emitted_at=int(datetime.now().timestamp()) * 1000
),
)

def _make_request(self, config):
parsed_config = self._parse_config(config)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ENV CODE_PATH="source_zoom_singer"
ENV AIRBYTE_IMPL_MODULE="source_zoom_singer"
ENV AIRBYTE_IMPL_PATH="SourceZoomSinger"

LABEL io.airbyte.version=0.2.1
LABEL io.airbyte.version=0.2.2
LABEL io.airbyte.name=airbyte/source-zoom-singer

WORKDIR /airbyte/integration_code
Expand Down

0 comments on commit 3569b68

Please sign in to comment.