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 6067dbb7163c..4ff6c5db0593 100644 --- a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml @@ -1185,11 +1185,14 @@ - name: Notion sourceDefinitionId: 6e00b415-b02e-4160-bf02-58176a0ae687 dockerRepository: airbyte/source-notion - dockerImageTag: 1.0.1 + dockerImageTag: 1.0.2 documentationUrl: https://docs.airbyte.com/integrations/sources/notion icon: notion.svg sourceType: api releaseStage: generally_available + allowedHosts: + hosts: + - "api.notion.com" - name: New York Times sourceDefinitionId: 0fae6a9a-04eb-44d4-96e1-e02d3dbc1d83 dockerRepository: airbyte/source-nytimes 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 d20ad2b750da..f31b58523fcc 100644 --- a/airbyte-config/init/src/main/resources/seed/source_specs.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_specs.yaml @@ -9973,7 +9973,7 @@ supportsNormalization: false supportsDBT: false supported_destination_sync_modes: [] -- dockerImage: "airbyte/source-notion:1.0.1" +- dockerImage: "airbyte/source-notion:1.0.2" spec: documentationUrl: "https://docs.airbyte.com/integrations/sources/notion" connectionSpecification: diff --git a/airbyte-integrations/connectors/source-notion/Dockerfile b/airbyte-integrations/connectors/source-notion/Dockerfile index c6dad22d2b0b..bbe6ad25fa9f 100644 --- a/airbyte-integrations/connectors/source-notion/Dockerfile +++ b/airbyte-integrations/connectors/source-notion/Dockerfile @@ -34,5 +34,5 @@ COPY source_notion ./source_notion ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py" ENTRYPOINT ["python", "/airbyte/integration_code/main.py"] -LABEL io.airbyte.version=1.0.1 +LABEL io.airbyte.version=1.0.2 LABEL io.airbyte.name=airbyte/source-notion diff --git a/airbyte-integrations/connectors/source-notion/source_notion/streams.py b/airbyte-integrations/connectors/source-notion/source_notion/streams.py index 2c38d246030a..dd4f84b4841a 100644 --- a/airbyte-integrations/connectors/source-notion/source_notion/streams.py +++ b/airbyte-integrations/connectors/source-notion/source_notion/streams.py @@ -38,6 +38,9 @@ def backoff_time(self, response: requests.Response) -> Optional[float]: if retry_after: return float(retry_after) + def should_retry(self, response: requests.Response) -> bool: + return response.status_code == 400 or super().should_retry(response) + def request_headers(self, **kwargs) -> Mapping[str, Any]: params = super().request_headers(**kwargs) # Notion API version, see https://developers.notion.com/reference/versioning diff --git a/airbyte-integrations/connectors/source-notion/unit_tests/test_streams.py b/airbyte-integrations/connectors/source-notion/unit_tests/test_streams.py index 1d1e4b7eb32c..cf169f5e8d8e 100644 --- a/airbyte-integrations/connectors/source-notion/unit_tests/test_streams.py +++ b/airbyte-integrations/connectors/source-notion/unit_tests/test_streams.py @@ -61,7 +61,7 @@ def test_http_method(patch_base_class): ("http_status", "should_retry"), [ (HTTPStatus.OK, False), - (HTTPStatus.BAD_REQUEST, False), + (HTTPStatus.BAD_REQUEST, True), (HTTPStatus.TOO_MANY_REQUESTS, True), (HTTPStatus.INTERNAL_SERVER_ERROR, True), ], diff --git a/connectors.md b/connectors.md index 16a56f495f74..26ca525d2ce6 100644 --- a/connectors.md +++ b/connectors.md @@ -148,7 +148,7 @@ | **New York Times** | New York Times icon | Source | airbyte/source-nytimes:0.1.0 | alpha | [link](https://docs.airbyte.com/integrations/sources/nytimes) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-nytimes) | `0fae6a9a-04eb-44d4-96e1-e02d3dbc1d83` | | **News API** | News API icon | Source | airbyte/source-news-api:0.1.0 | alpha | [link](https://docs.airbyte.com/integrations/sources/news-api) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-news-api) | `df38991e-f35b-4af2-996d-36817f614587` | | **Newsdata** | x | Source | airbyte/source-newsdata:0.1.0 | alpha | [link](https://docs.airbyte.com/integrations/sources/newsdata) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-newsdata) | `60bd11d8-2632-4daa-a688-b47336d32093` | -| **Notion** | Notion icon | Source | airbyte/source-notion:1.0.1 | generally_available | [link](https://docs.airbyte.com/integrations/sources/notion) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-notion) | `6e00b415-b02e-4160-bf02-58176a0ae687` | +| **Notion** | Notion icon | Source | airbyte/source-notion:1.0.2 | generally_available | [link](https://docs.airbyte.com/integrations/sources/notion) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-notion) | `6e00b415-b02e-4160-bf02-58176a0ae687` | | **Okta** | Okta icon | Source | airbyte/source-okta:0.1.14 | alpha | [link](https://docs.airbyte.com/integrations/sources/okta) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-okta) | `1d4fdb25-64fc-4569-92da-fcdca79a8372` | | **Omnisend** | Omnisend icon | Source | airbyte/source-omnisend:0.1.0 | alpha | [link](https://docs.airbyte.com/integrations/sources/omnisend) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-omnisend) | `e7f0c5e2-4815-48c4-90cf-f47124209835` | | **OneSignal** | OneSignal icon | Source | airbyte/source-onesignal:0.1.2 | alpha | [link](https://docs.airbyte.com/integrations/sources/onesignal) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-onesignal) | `bb6afd81-87d5-47e3-97c4-e2c2901b1cf8` | diff --git a/docs/integrations/sources/notion.md b/docs/integrations/sources/notion.md index bbbeec218185..d8006b560fbe 100644 --- a/docs/integrations/sources/notion.md +++ b/docs/integrations/sources/notion.md @@ -84,7 +84,8 @@ The connector is restricted by Notion [request limits](https://developers.notion | Version | Date | Pull Request | Subject | |:--------|:-----------|:---------------------------------------------------------|:----------------------------------------------------------------| -| 1.0.1 | 2023-01-27 | [22018](https://github.com/airbytehq/airbyte/pull/22018) | Set `AvailabilityStrategy` for streams explicitly to `None` | +| 1.0.2 | 2023-02-24 | [23437](https://github.com/airbytehq/airbyte/pull/23437) | Add retry for 400 error (validation_error) | +| 1.0.1 | 2023-01-27 | [22018](https://github.com/airbytehq/airbyte/pull/22018) | Set `AvailabilityStrategy` for streams explicitly to `None` | | 1.0.0 | 2022-12-19 | [20639](https://github.com/airbytehq/airbyte/pull/20639) | Fix `Pages` stream schema | | 0.1.10 | 2022-09-28 | [17298](https://github.com/airbytehq/airbyte/pull/17298) | Use "Retry-After" header for backoff | | 0.1.9 | 2022-09-16 | [16799](https://github.com/airbytehq/airbyte/pull/16799) | Migrate to per-stream state |