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

🚨🚨 Source Instagram: upgrade to v18 #33930

Merged
merged 14 commits into from
Jan 5, 2024

Conversation

artem1205
Copy link
Collaborator

@artem1205 artem1205 commented Jan 4, 2024

What

Resolve #33899

How

upgrade to v18

Recommended reading order

  1. airbyte-integrations/connectors/source-instagram/setup.py
  2. streams.py

🚨 User Impact 🚨

Reauthentication for all users required, scope added: business_management
see https://github.com/airbytehq/airbyte-platform-internal/pull/10582

  • Stream Media Insights

    Old metric New metric
    carousel_album_engagement total_interactions
    carousel_album_impressions impressions
    carousel_album_reach reach
    carousel_album_saved saved
    carousel_album_video_views video_views
    engagement total_interactions

    New metrics for Reels: ig_reels_avg_watch_time, ig_reels_video_view_total_time

  • Stream UserLifetimeInsights

    Metric audience_locale become unavailable.
    Metrics audience_city, audience_country and audience_gender_age changed to one metric follower_demographics with respective breakdowns city, country, age,gender.
    primary key changed to ["business_account_id", "breakdown"]
    date property deleted.
    Metric type set to total_value, see docs for more info.

  • Stream StoryInsights
    deprecated metrics: exits, taps_forward, taps_back

Pre-merge Actions

Updating a connector

Community member or Airbyter

  • Grant edit access to maintainers (instructions)
  • Unit & integration tests added

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • If new credentials are required for use in CI, add them to GSM. Instructions.

Copy link

vercel bot commented Jan 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
airbyte-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 5, 2024 10:51pm

Copy link
Contributor

github-actions bot commented Jan 4, 2024

Before Merging a Connector Pull Request

Wow! What a great pull request you have here! 🎉

To merge this PR, ensure the following has been done/considered for each connector added or updated:

  • PR name follows PR naming conventions
  • Breaking changes are considered. If a Breaking Change is being introduced, ensure an Airbyte engineer has created a Breaking Change Plan.
  • Connector version has been incremented in the Dockerfile and metadata.yaml according to our Semantic Versioning for Connectors guidelines
  • You've updated the connector's metadata.yaml file any other relevant changes, including a breakingChanges entry for major version bumps. See metadata.yaml docs
  • Secrets in the connector's spec are annotated with airbyte_secret
  • All documentation files are up to date. (README.md, bootstrap.md, docs.md, etc...)
  • Changelog updated in docs/integrations/<source or destination>/<name>.md with an entry for the new version. See changelog example
  • Migration guide updated in docs/integrations/<source or destination>/<name>-migrations.md with an entry for the new version, if the version is a breaking change. See migration guide example
  • If set, you've ensured the icon is present in the platform-internal repo. (Docs)

If the checklist is complete, but the CI check is failing,

  1. Check for hidden checklists in your PR description

  2. Toggle the github label checklist-action-run on/off to re-run the checklist CI.

@artem1205 artem1205 self-assigned this Jan 4, 2024
@octavia-squidington-iii octavia-squidington-iii added the area/documentation Improvements or additions to documentation label Jan 5, 2024
@artem1205 artem1205 marked this pull request as ready for review January 5, 2024 12:59
@octavia-squidington-iv octavia-squidington-iv requested review from a team January 5, 2024 13:01
Copy link
Contributor

@maxi297 maxi297 left a comment

Choose a reason for hiding this comment

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

This seems on the right track but I lack information to approve. Can you answer those questions?

@@ -143,10 +143,18 @@ def read_records(
class UserLifetimeInsights(DatetimeTransformerMixin, InstagramStream):
"""Docs: https://developers.facebook.com/docs/instagram-api/reference/ig-user/insights"""

primary_key = ["business_account_id", "metric", "date"]
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't have any sample response from the previous version so I can't confirm what date really was. However, if the value was being updated every sync, it would mean that there was a new entry created in the destination every time. This will not be the case anymore. Is this an issue? Should we document this behavior change?

Copy link
Collaborator Author

@artem1205 artem1205 Jan 5, 2024

Choose a reason for hiding this comment

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

You could find previous version here
This is an issue, because data will be returned for ALL period, see https://github.com/airbytehq/airbyte/pull/33930/files#diff-ade20df2f7ea130a82ed265a6a96eb70c0d9ccb98e92bb61afdb5b05c146525fR33

Copy link
Contributor

Choose a reason for hiding this comment

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

So basically, we are moving from metric_type=time_series to metric_type= total_value, right? If so, is this what the customer wants? This seems like a different stream entirely

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not really, we'll receive the most similar metrics as it was described in FB docs (alternative metric)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes but they are not over time right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, they are "lifetime", just 1 record per metric without any date.

Copy link
Contributor

Choose a reason for hiding this comment

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

Now yes, but before, "date" was part of the primary key right? So we could have multiple entries in the database for the same metric (depending on the date)

Copy link
Contributor

Choose a reason for hiding this comment

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

Sync discussion summary: The metric does not support time_series. So this is a breaking change and we don't have an easy way around it. We're fine with the change and will try to intercept user feedback if this is not good enough. In the meanwhile, @artem1205 will document the change better in the migration guide.

@artem1205 artem1205 requested a review from maxi297 January 5, 2024 21:12
Copy link
Contributor

@maxi297 maxi297 left a comment

Choose a reason for hiding this comment

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

LGTM! :shipit:

Copy link
Contributor

@katmarkham katmarkham left a comment

Choose a reason for hiding this comment

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

please add link to migration guide and make other changes requested

docs/integrations/sources/instagram-migrations.md Outdated Show resolved Hide resolved
docs/integrations/sources/instagram-migrations.md Outdated Show resolved Hide resolved
@octavia-squidington-iv octavia-squidington-iv requested a review from a team January 5, 2024 22:06
@maxi297 maxi297 merged commit 2f92501 into master Jan 5, 2024
25 of 27 checks passed
@maxi297 maxi297 deleted the artem1205/source-instagram-33899 branch January 5, 2024 23:56
jatinyadav-cc pushed a commit to ollionorg/datapipes-airbyte that referenced this pull request Feb 26, 2024
Co-authored-by: Maxime Carbonneau-Leclerc <3360483+maxi297@users.noreply.github.com>
jatinyadav-cc pushed a commit to ollionorg/datapipes-airbyte that referenced this pull request Feb 26, 2024
Co-authored-by: Maxime Carbonneau-Leclerc <3360483+maxi297@users.noreply.github.com>
jatinyadav-cc pushed a commit to ollionorg/datapipes-airbyte that referenced this pull request Feb 26, 2024
Co-authored-by: Maxime Carbonneau-Leclerc <3360483+maxi297@users.noreply.github.com>
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 connectors/source/instagram
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Source Instagram: migrate to latest API (v18)
4 participants