Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🎉 Instagram Source: Migrate to use CDK, upgrade API version and fix failures with HTTP status 400 #4210

Merged
merged 29 commits into from
Jul 7, 2021

Conversation

yevhenii-ldv
Copy link
Contributor

@yevhenii-ldv yevhenii-ldv commented Jun 18, 2021

What

closes #4028 .

This PR:

  • migrates Instagram to CDK
  • upgrades to the latest API version (11.0)
  • improves error handling and backoff using custom FacebookAdsAPI class
  • integrates SAT
  • adds custom integration test for the incremental stream with nested cursor field

Recommended reading order

  1. streams.py
  2. api.py
  3. source.py

Pre-merge Checklist

Expand the checklist which is relevant for this PR.

Connector checklist

  • Issue acceptance criteria met
  • PR name follows PR naming conventions
  • Secrets are annotated with airbyte_secret in output spec
  • Unit & integration tests added as appropriate (and are passing)
    • Community members: please provide proof of this succeeding locally e.g: screenshot or copy-paste acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • /test connector=connectors/<name> command as documented here is passing.
    • Community members can skip this, Airbyters will run this for you.
  • Code reviews completed
  • Credentials added to Github CI if needed and not already present. instructions for injecting secrets into CI.
  • Documentation updated
    • README
    • CHANGELOG.md
    • Reference docs in the docs/integrations/ directory.
    • Build status added to build page
  • Build is successful
  • Connector version bumped like described here
  • New Connector version released on Dockerhub by running the /publish command described here
  • No major blockers
  • PR merged into master branch
  • Follow up tickets have been created
  • Associated tickets have been closed & stakeholders notified

Connector Generator checklist

  • Issue acceptance criteria met
  • PR name follows PR naming conventions
  • If adding a new generator, add it to the list of scaffold modules being tested
  • The generator test modules (all connectors with -scaffold in their name) have been updated with the latest scaffold by running ./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates then checking in your changes
  • Documentation which references the generator is updated as needed.

@github-actions github-actions bot added the area/connectors Connector related issues label Jun 18, 2021
@yevhenii-ldv
Copy link
Contributor Author

yevhenii-ldv commented Jun 18, 2021

/test connector=connectors/source-instagram

🕑 connectors/source-instagram https://github.com/airbytehq/airbyte/actions/runs/950424462
✅ connectors/source-instagram https://github.com/airbytehq/airbyte/actions/runs/950424462

@github-actions github-actions bot added the area/documentation Improvements or additions to documentation label Jul 6, 2021
@keu keu requested review from Zirochkaa, htrueman and sherifnada July 6, 2021 20:43
@keu
Copy link
Contributor

keu commented Jul 6, 2021

/test connector=source-instagram

🕑 source-instagram https://github.com/airbytehq/airbyte/actions/runs/1005777039
❌ source-instagram https://github.com/airbytehq/airbyte/actions/runs/1005777039

@keu
Copy link
Contributor

keu commented Jul 6, 2021

/test connector=source-instagram

🕑 source-instagram https://github.com/airbytehq/airbyte/actions/runs/1005801268
✅ source-instagram https://github.com/airbytehq/airbyte/actions/runs/1005801268

@keu keu changed the title Instagram Source: Fixing sync fail with HTTP status 400 Instagram Source: Migrate to use CDK, upgrade API version and fix failures with HTTP status 400 Jul 6, 2021
@keu keu self-assigned this Jul 6, 2021
@keu keu changed the title Instagram Source: Migrate to use CDK, upgrade API version and fix failures with HTTP status 400 🎉 Instagram Source: Migrate to use CDK, upgrade API version and fix failures with HTTP status 400 Jul 6, 2021
@keu keu changed the title 🎉 Instagram Source: Migrate to use CDK, upgrade API version and fix failures with HTTP status 400 🎉 Instagram Source: Migrate to use CDK, upgrade API version and fix failures with HTTP status 400 Jul 6, 2021
@sherifnada sherifnada requested a review from tuliren July 6, 2021 23:03
class TestInstagramSource:
"""Custom integration tests should test incremental with nested state"""

def test_incremental_streams(self, configured_catalog, config, state):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

Comment on lines +32 to +33
"pendulum>=2,<3",
"backoff",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These libraries are installed together with airbyte-cdk. Do we need to explicitly specify them?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is better to specify dependencies like this explicitly because CDK might drop this dependency

@yevhenii-ldv
Copy link
Contributor Author

LGTM

@keu
Copy link
Contributor

keu commented Jul 7, 2021

/publish connector=connectors/source-instagram

🕑 connectors/source-instagram https://github.com/airbytehq/airbyte/actions/runs/1008968368
✅ connectors/source-instagram https://github.com/airbytehq/airbyte/actions/runs/1008968368

@keu keu merged commit c8b8b52 into master Jul 7, 2021
@keu keu deleted the ykurochkin/instagram-api-sync-failed-repeatedly branch July 7, 2021 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connectors Connector related issues area/documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Instagram API sync failed repeatedly and now only syncing 10% of records
6 participants