From 1da4abb7b18034fcc9cd678cf07b54e306528afd Mon Sep 17 00:00:00 2001 From: Sajarin Date: Thu, 5 Jan 2023 12:21:05 -0500 Subject: [PATCH] Source AlphaVantage - add quote stream to alpha-vantage (#20564) * feat: add quote stream to alpha-vantage * updated spec.yaml with correct order values * docs: updated docs * auto-bump connector version Co-authored-by: Octavia Squidington III --- .../resources/seed/source_definitions.yaml | 2 +- .../src/main/resources/seed/source_specs.yaml | 6 +-- .../source-alpha-vantage/Dockerfile | 2 +- .../acceptance-test-config.yml | 2 + .../acceptance-test-docker.sh | 0 .../integration_tests/configured_catalog.json | 9 +++++ .../source_alpha_vantage/alpha_vantage.yaml | 10 ++++- .../source_alpha_vantage/schemas/quote.json | 38 +++++++++++++++++++ .../source_alpha_vantage/spec.yaml | 4 +- docs/integrations/sources/alpha-vantage.md | 1 + 10 files changed, 66 insertions(+), 8 deletions(-) mode change 100644 => 100755 airbyte-integrations/connectors/source-alpha-vantage/acceptance-test-docker.sh create mode 100644 airbyte-integrations/connectors/source-alpha-vantage/source_alpha_vantage/schemas/quote.json diff --git a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml index 1ab71a58ccd6..9e53df5a2208 100644 --- a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml @@ -31,7 +31,7 @@ - name: Alpha Vantage sourceDefinitionId: db385323-9333-4fec-bec3-9e0ca9326c90 dockerRepository: airbyte/source-alpha-vantage - dockerImageTag: 0.1.0 + dockerImageTag: 0.1.1 documentationUrl: https://docs.airbyte.com/integrations/sources/alpha-vantage sourceType: api releaseStage: alpha diff --git a/airbyte-config/init/src/main/resources/seed/source_specs.yaml b/airbyte-config/init/src/main/resources/seed/source_specs.yaml index 1fbaa1a1d9ed..56a59de04c41 100644 --- a/airbyte-config/init/src/main/resources/seed/source_specs.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_specs.yaml @@ -242,7 +242,7 @@ supportsNormalization: false supportsDBT: false supported_destination_sync_modes: [] -- dockerImage: "airbyte/source-alpha-vantage:0.1.0" +- dockerImage: "airbyte/source-alpha-vantage:0.1.1" spec: documentationUrl: "https://docs.airbyte.io/integrations/sources/alpha-vantage" connectionSpecification: @@ -285,7 +285,7 @@ description: "Whether to return adjusted data. Only applicable to intraday\ \ endpoints.\n" default: false - order: 4 + order: 3 outputsize: title: "Output Size" type: "string" @@ -295,7 +295,7 @@ - "compact" - "full" default: "compact" - order: 5 + order: 4 supportsNormalization: false supportsDBT: false supported_destination_sync_modes: [] diff --git a/airbyte-integrations/connectors/source-alpha-vantage/Dockerfile b/airbyte-integrations/connectors/source-alpha-vantage/Dockerfile index 7735d2dd4e93..e53d2506181b 100644 --- a/airbyte-integrations/connectors/source-alpha-vantage/Dockerfile +++ b/airbyte-integrations/connectors/source-alpha-vantage/Dockerfile @@ -34,5 +34,5 @@ COPY source_alpha_vantage ./source_alpha_vantage 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.1.1 LABEL io.airbyte.name=airbyte/source-alpha-vantage diff --git a/airbyte-integrations/connectors/source-alpha-vantage/acceptance-test-config.yml b/airbyte-integrations/connectors/source-alpha-vantage/acceptance-test-config.yml index daf327f8c10e..4f8e9525c8e3 100644 --- a/airbyte-integrations/connectors/source-alpha-vantage/acceptance-test-config.yml +++ b/airbyte-integrations/connectors/source-alpha-vantage/acceptance-test-config.yml @@ -15,7 +15,9 @@ tests: - config_path: "secrets/config.json" configured_catalog_path: "integration_tests/configured_catalog.json" empty_streams: + - "time_series_daily" - "time_series_monthly" + - "quote" full_refresh: - config_path: "secrets/config.json" configured_catalog_path: "integration_tests/configured_catalog.json" diff --git a/airbyte-integrations/connectors/source-alpha-vantage/acceptance-test-docker.sh b/airbyte-integrations/connectors/source-alpha-vantage/acceptance-test-docker.sh old mode 100644 new mode 100755 diff --git a/airbyte-integrations/connectors/source-alpha-vantage/integration_tests/configured_catalog.json b/airbyte-integrations/connectors/source-alpha-vantage/integration_tests/configured_catalog.json index dfafcb1e168f..400e6dac3d9c 100644 --- a/airbyte-integrations/connectors/source-alpha-vantage/integration_tests/configured_catalog.json +++ b/airbyte-integrations/connectors/source-alpha-vantage/integration_tests/configured_catalog.json @@ -26,6 +26,15 @@ }, "sync_mode": "full_refresh", "destination_sync_mode": "overwrite" + }, + { + "stream": { + "name": "quote", + "json_schema": {}, + "supported_sync_modes": ["full_refresh"] + }, + "sync_mode": "full_refresh", + "destination_sync_mode": "overwrite" } ] } diff --git a/airbyte-integrations/connectors/source-alpha-vantage/source_alpha_vantage/alpha_vantage.yaml b/airbyte-integrations/connectors/source-alpha-vantage/source_alpha_vantage/alpha_vantage.yaml index 027e51ef11f3..334fa06f60e7 100644 --- a/airbyte-integrations/connectors/source-alpha-vantage/source_alpha_vantage/alpha_vantage.yaml +++ b/airbyte-integrations/connectors/source-alpha-vantage/source_alpha_vantage/alpha_vantage.yaml @@ -1,4 +1,4 @@ -version: "0.1.0" +version: "0.1.1" definitions: schema_loader: @@ -91,6 +91,13 @@ definitions: function: "TIME_SERIES_MONTHLY_ADJUSTED" path: "/query" key_field: "date" + quote_stream: + $ref: "*ref(definitions.base_stream)" + $options: + name: "quote" + function: "GLOBAL_QUOTE" + path: "/query" + streams: - "*ref(definitions.time_series_intraday_stream)" @@ -100,6 +107,7 @@ streams: - "*ref(definitions.time_series_weekly_adjusted_stream)" - "*ref(definitions.time_series_monthly_stream)" - "*ref(definitions.time_series_monthly_adjusted_stream)" + - "*ref(definitions.quote_stream)" check: stream_names: diff --git a/airbyte-integrations/connectors/source-alpha-vantage/source_alpha_vantage/schemas/quote.json b/airbyte-integrations/connectors/source-alpha-vantage/source_alpha_vantage/schemas/quote.json new file mode 100644 index 000000000000..036b48903dc2 --- /dev/null +++ b/airbyte-integrations/connectors/source-alpha-vantage/source_alpha_vantage/schemas/quote.json @@ -0,0 +1,38 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "Global Quote": { + "01. symbol": { + "type": ["string", "null"] + }, + "02. open": { + "type": ["string", "null"] + }, + "03. high": { + "type": ["string", "null"] + }, + "04. low": { + "type": ["string", "null"] + }, + "05. price": { + "type": ["string", "null"] + }, + "06. volume": { + "type": ["string", "null"] + }, + "07. latest trading day": { + "type": ["string", "null"] + }, + "08. previous close": { + "type": ["string", "null"] + }, + "09. change": { + "type": ["string", "null"] + }, + "10. change percent": { + "type": ["string", "null"] + } + } + } + } \ No newline at end of file diff --git a/airbyte-integrations/connectors/source-alpha-vantage/source_alpha_vantage/spec.yaml b/airbyte-integrations/connectors/source-alpha-vantage/source_alpha_vantage/spec.yaml index cc8a1401b28f..4712fd5d5dce 100644 --- a/airbyte-integrations/connectors/source-alpha-vantage/source_alpha_vantage/spec.yaml +++ b/airbyte-integrations/connectors/source-alpha-vantage/source_alpha_vantage/spec.yaml @@ -40,7 +40,7 @@ connectionSpecification: description: | Whether to return adjusted data. Only applicable to intraday endpoints. default: false - order: 4 + order: 3 outputsize: title: Output Size type: string @@ -50,4 +50,4 @@ connectionSpecification: - compact - full default: compact - order: 5 + order: 4 diff --git a/docs/integrations/sources/alpha-vantage.md b/docs/integrations/sources/alpha-vantage.md index 17dc5daea00f..72789514e193 100644 --- a/docs/integrations/sources/alpha-vantage.md +++ b/docs/integrations/sources/alpha-vantage.md @@ -59,4 +59,5 @@ The following fields are required fields for the connector to work: | Version | Date | Pull Request | Subject | |:--------|:-----------|:---------------------------------------------------------|:-----------| +| 0.1.1 | 2022-12-16 | [20564](https://github.com/airbytehq/airbyte/pull/20564) | add quote stream to alpha-vantage | | 0.1.0 | 2022-10-21 | [18320](https://github.com/airbytehq/airbyte/pull/18320) | New source |