Skip to content

Commit

Permalink
Source Instagram: decrease give up rate (#23671)
Browse files Browse the repository at this point in the history
* updated spec and added more specific error message

* added change log

* refactored error handling

* auto-bump connector version

---------

Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
  • Loading branch information
2 people authored and erohmensing committed Mar 22, 2023
1 parent d80cbc4 commit 090ef75
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,7 @@
- name: Instagram
sourceDefinitionId: 6acf6b55-4f1e-4fca-944e-1a3caef8aba8
dockerRepository: airbyte/source-instagram
dockerImageTag: 1.0.3
dockerImageTag: 1.0.4
documentationUrl: https://docs.airbyte.com/integrations/sources/instagram
icon: instagram.svg
sourceType: api
Expand Down
9 changes: 5 additions & 4 deletions airbyte-config/init/src/main/resources/seed/source_specs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6959,7 +6959,7 @@
supportsNormalization: false
supportsDBT: false
supported_destination_sync_modes: []
- dockerImage: "airbyte/source-instagram:1.0.3"
- dockerImage: "airbyte/source-instagram:1.0.4"
spec:
documentationUrl: "https://docs.airbyte.com/integrations/sources/instagram"
changelogUrl: "https://docs.airbyte.com/integrations/sources/instagram"
Expand All @@ -6979,9 +6979,10 @@
format: "date-time"
access_token:
title: "Access Token"
description: "The value of the access token generated. See the <a href=\"\
https://docs.airbyte.com/integrations/sources/instagram\">docs</a> for\
\ more information"
description: "The value of the access token generated with <b>instagram_basic,\
\ instagram_manage_insights, pages_show_list, pages_read_engagement, Instagram\
\ Public Content Access</b> permissions. See the <a href=\"https://docs.airbyte.com/integrations/sources/instagram/#step-1-set-up-instagram\"\
>docs</a> for more information"
airbyte_secret: true
type: "string"
required:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ RUN pip install .
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]

LABEL io.airbyte.version=1.0.3
LABEL io.airbyte.version=1.0.4
LABEL io.airbyte.name=airbyte/source-instagram
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"access_token": {
"title": "Access Token",
"description": "The value of the access token generated. See the <a href=\"https://docs.airbyte.com/integrations/sources/instagram\">docs</a> for more information",
"description": "The value of the access token generated with <b>instagram_basic, instagram_manage_insights, pages_show_list, pages_read_engagement, Instagram Public Content Access</b> permissions. See the <a href=\"https://docs.airbyte.com/integrations/sources/instagram/#step-1-set-up-instagram\">docs</a> for more information",
"airbyte_secret": true,
"type": "string"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,16 @@ def _find_accounts(self) -> List[Mapping[str, Any]]:
}
)
except FacebookRequestError as exc:
# 200 - 299, 3 and 10 are permission related error codes
if 200 <= exc.api_error_code() <= 299 or exc.api_error_code() in [3, 10]:
raise InstagramAPIException(
f"Error: {exc.api_error_code()}, {exc.api_error_message()}."
f"Also make sure that your Access Token has the following permissions: "
f"instagram_basic, instagram_manage_insights, pages_show_list, pages_read_engagement, and Instagram Public Content Access"
f"See error handling https://developers.facebook.com/docs/graph-api/guides/error-handling/ "
f"and permissions https://developers.facebook.com/docs/permissions/reference for more information."
) from exc

raise InstagramAPIException(f"Error: {exc.api_error_code()}, {exc.api_error_message()}") from exc

if not instagram_business_accounts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ class Config:
)

access_token: str = Field(
description='The value of the access token generated. See the <a href="https://docs.airbyte.com/integrations/sources/instagram">docs</a> for more information',
description=(
"The value of the access token generated with "
"<b>instagram_basic, instagram_manage_insights, pages_show_list, pages_read_engagement, Instagram Public Content Access</b> "
"permissions. "
'See the <a href="https://docs.airbyte.com/integrations/sources/instagram/#step-1-set-up-instagram">docs</a> for more '
"information"
),
airbyte_secret=True,
)

Expand Down
2 changes: 1 addition & 1 deletion connectors.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
| **IBM Db2** | <img alt="IBM Db2 icon" src="https://raw.githubusercontent.com/airbytehq/airbyte/master/airbyte-config/init/src/main/resources/icons/db2.svg" height="30" height="30"/> | Source | airbyte/source-db2:0.1.18 | alpha | [link](https://docs.airbyte.com/integrations/sources/db2) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-db2) | <small>`447e0381-3780-4b46-bb62-00a4e3c8b8e2`</small> |
| **IP2Whois** | <img alt="IP2Whois icon" src="https://raw.githubusercontent.com/airbytehq/airbyte/master/airbyte-config/init/src/main/resources/icons/ip2whois.svg" height="30" height="30"/> | Source | airbyte/source-ip2whois:0.1.0 | alpha | [link](https://docs.airbyte.com/integrations/sources/ip2whois) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-ip2whois) | <small>`f23b7b7c-d705-49a3-9042-09add3b104a5`</small> |
| **Insightly** | <img alt="Insightly icon" src="https://raw.githubusercontent.com/airbytehq/airbyte/master/airbyte-config/init/src/main/resources/icons/insightly.svg" height="30" height="30"/> | Source | airbyte/source-insightly:0.1.1 | alpha | [link](https://docs.airbyte.com/integrations/sources/insightly) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-insightly) | <small>`38f84314-fe6a-4257-97be-a8dcd942d693`</small> |
| **Instagram** | <img alt="Instagram icon" src="https://raw.githubusercontent.com/airbytehq/airbyte/master/airbyte-config/init/src/main/resources/icons/instagram.svg" height="30" height="30"/> | Source | airbyte/source-instagram:1.0.3 | generally_available | [link](https://docs.airbyte.com/integrations/sources/instagram) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-instagram) | <small>`6acf6b55-4f1e-4fca-944e-1a3caef8aba8`</small> |
| **Instagram** | <img alt="Instagram icon" src="https://raw.githubusercontent.com/airbytehq/airbyte/master/airbyte-config/init/src/main/resources/icons/instagram.svg" height="30" height="30"/> | Source | airbyte/source-instagram:1.0.4 | generally_available | [link](https://docs.airbyte.com/integrations/sources/instagram) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-instagram) | <small>`6acf6b55-4f1e-4fca-944e-1a3caef8aba8`</small> |
| **Instatus** | <img alt="Instatus icon" src="https://raw.githubusercontent.com/airbytehq/airbyte/master/airbyte-config/init/src/main/resources/icons/instatus.svg" height="30" height="30"/> | Source | airbyte/source-instatus:0.1.0 | alpha | [link](https://docs.airbyte.com/integrations/sources/instatus) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-instatus) | <small>`1901024c-0249-45d0-bcac-31a954652927`</small> |
| **Intercom** | <img alt="Intercom icon" src="https://raw.githubusercontent.com/airbytehq/airbyte/master/airbyte-config/init/src/main/resources/icons/intercom.svg" height="30" height="30"/> | Source | airbyte/source-intercom:0.1.32 | generally_available | [link](https://docs.airbyte.com/integrations/sources/intercom) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-intercom) | <small>`d8313939-3782-41b0-be29-b3ca20d8dd3a`</small> |
| **Intruder** | <img alt="Intruder icon" src="https://raw.githubusercontent.com/airbytehq/airbyte/master/airbyte-config/init/src/main/resources/icons/intruder.svg" height="30" height="30"/> | Source | airbyte/source-intruder:0.1.0 | alpha | [link](https://docs.airbyte.com/integrations/sources/intruder) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-intruder) | <small>`3d15163b-11d8-412f-b808-795c9b2c3a3a`</small> |
Expand Down
1 change: 1 addition & 0 deletions docs/integrations/sources/instagram.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ AirbyteRecords are required to conform to the [Airbyte type](https://docs.airbyt

| Version | Date | Pull Request | Subject |
|:--------|:-----------|:---------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------|
| 1.0.4 | 2023-03-15 | [23671](https://github.com/airbytehq/airbyte/pull/23671) | Add info about main permissions in spec and doc links in error message to navigate user |
| 1.0.3 | 2023-03-14 | [24043](https://github.com/airbytehq/airbyte/pull/24043) | Do not emit incomplete records for `user_insights` stream |
| 1.0.2 | 2023-03-14 | [24042](https://github.com/airbytehq/airbyte/pull/24042) | Test publish flow |
| 1.0.1 | 2023-01-19 | [21602](https://github.com/airbytehq/airbyte/pull/21602) | Handle abnormally large state values |
Expand Down

0 comments on commit 090ef75

Please sign in to comment.