Skip to content

Commit

Permalink
Update source-gnews manifest to use inline stream schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
clnoll committed Dec 13, 2022
1 parent 4b4c769 commit f326718
Show file tree
Hide file tree
Showing 5 changed files with 115 additions and 90 deletions.
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-gnews/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from setuptools import find_packages, setup

MAIN_REQUIREMENTS = [
"airbyte-cdk~=0.1",
"airbyte-cdk~=0.13.2",
]

TEST_REQUIREMENTS = [
Expand Down
110 changes: 110 additions & 0 deletions airbyte-integrations/connectors/source-gnews/source_gnews/gnews.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,107 @@
version: "0.1.0"

schemas:
search_stream_schema:
type: object
properties:
title:
type:
- "null"
- string
description: The main title of the article.
description:
type:
- "null"
- string
description: The small paragraph under the title.
content:
type:
- "null"
- string
description: All the content of the article.
url:
type:
- "null"
- string
description: The URL of the article.
image:
type:
- "null"
- string
description: The main image of the article.
publishedAt:
type:
- "null"
- string
description:
The date of publication of the article. The date is always in the
UTC time zone.
source:
type:
- "null"
- object
properties:
name:
type:
- "null"
- string
description: The name of the source.
url:
type:
- "null"
- string
description: The home page of the source.
top_headlines_stream_schema:
type: object
properties:
title:
type:
- "null"
- string
description: The main title of the article.
description:
type:
- "null"
- string
description: The small paragraph under the title.
content:
type:
- "null"
- string
description: All the content of the article.
url:
type:
- "null"
- string
description: The URL of the article.
image:
type:
- "null"
- string
description: The main image of the article.
publishedAt:
type:
- "null"
- string
description:
The date of publication of the article. The date is always in the
UTC time zone.
source:
type:
- "null"
- object
properties:
name:
type:
- "null"
- string
description: The name of the source.
url:
type:
- "null"
- string
description: The home page of the source.

definitions:
selector:
extractor:
Expand Down Expand Up @@ -44,7 +146,12 @@ definitions:
nullable: "{{ ','.join(config['nullable']) }}"
from: "{{ stream_slice['start_time'] }}"
to: "{{ stream_slice['end_time'] }}"
schema_loader:
type: StaticSchemaLoader
search_stream:
schema_loader:
$ref: "*ref(definitions.schema_loader)"
schema: "*ref(schemas.search_stream_schema)"
$options:
name: "search"
primary_key: "url"
Expand All @@ -61,6 +168,9 @@ definitions:
in: "{{ ','.join(config['in']) }}"
sortby: "{{ config['sortby'] }}"
top_headlines_stream:
schema_loader:
$ref: "*ref(definitions.schema_loader)"
schema: "*ref(schemas.top_headlines_stream_schema)"
$options:
name: "top_headlines"
primary_key: "url"
Expand Down

This file was deleted.

This file was deleted.

7 changes: 4 additions & 3 deletions docs/integrations/sources/gnews.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Rate Limiting is based on the API Key tier subscription, get more info [here](ht

## Changelog

| Version | Date | Pull Request | Subject |
|:--------|:-----------|:---------------------------------------------------------|:------------------------------------------------|
| 0.1.0 | 2022-11-01 | [18808](https://github.com/airbytehq/airbyte/pull/18808) | 🎉 New Source: GNews |
| Version | Date | Pull Request | Subject |
|:--------|:-----------|:---------------------------------------------------------|:-------------------------------------------------|
| 0.1.1 | 2022-12-13 | [20405](https://github.com/airbytehq/airbyte/pull/20405) | Update the manifest to use inline stream schemas |
| 0.1.0 | 2022-11-01 | [18808](https://github.com/airbytehq/airbyte/pull/18808) | 🎉 New Source: GNews |

0 comments on commit f326718

Please sign in to comment.