Skip to content

Commit

Permalink
🐛 Source Instagram: Remove deprecated metrics for media_insights and …
Browse files Browse the repository at this point in the history
…user_insights (#51018)
  • Loading branch information
maxi297 authored Jan 9, 2025
1 parent e79e4e3 commit 9dd5283
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 99 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ data:
connectorSubtype: api
connectorType: source
definitionId: 6acf6b55-4f1e-4fca-944e-1a3caef8aba8
dockerImageTag: 3.1.0
dockerImageTag: 3.1.1
dockerRepository: airbyte/source-instagram
githubIssueLabel: source-instagram
icon: instagram.svg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = [ "poetry-core>=1.0.0",]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
version = "3.1.0"
version = "3.1.1"
name = "source-instagram"
description = "Source implementation for Instagram."
authors = [ "Airbyte <[email protected]>",]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ definitions:
}}{% elif stream_partition.media_insights_info.media_type ==
"VIDEO" and
stream_partition.media_insights_info.media_product_type == "FEED"
%}{{ 'impressions,reach,saved,video_views'}}{% elif
%}{{ 'impressions,reach,saved'}}{% elif
stream_partition.media_insights_info.media_type == "VIDEO" %}{{
'impressions,reach,saved,video_views,likes,comments,shares,follows,profile_visits'
'impressions,reach,saved,likes,comments,shares,follows,profile_visits'
}}{%elif stream_partition.media_insights_info.media_type ==
"CAROUSEL_ALBUM"%}{{ 'impressions,reach,saved,video_views,shares,follows,profile_visits' }}{% else %}{{
'impressions,reach,saved,video_views,likes,comments,shares,follows,profile_visits' }}{%
"CAROUSEL_ALBUM"%}{{ 'impressions,reach,saved,shares,follows,profile_visits' }}{% else %}{{
'impressions,reach,saved,likes,comments,shares,follows,profile_visits' }}{%
endif %}
error_handler:
type: CompositeErrorHandler
Expand Down Expand Up @@ -824,11 +824,6 @@ schemas:
type:
- "null"
- integer
video_views:
description: The total number of views on video media.
type:
- "null"
- integer
comments:
description: The number of comments received on the media.
type:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@
"description": "The number of times users have saved the media.",
"type": ["null", "integer"]
},
"video_views": {
"description": "The total number of views on video media.",
"type": ["null", "integer"]
},
"comments": {
"description": "The number of comments received on the media.",
"type": ["null", "integer"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,14 @@
"description": "The total number of followers for the user's account.",
"type": ["null", "integer"]
},
"get_directions_clicks": {
"description": "The number of clicks to get directions to the user's business location.",
"type": ["null", "integer"]
},
"impressions": {
"description": "The total number of times the user's content has been displayed.",
"type": ["null", "integer"]
},
"phone_call_clicks": {
"description": "The number of clicks to call the user's business phone number.",
"type": ["null", "integer"]
},
"profile_views": {
"description": "The total number of views on the user's profile.",
"type": ["null", "integer"]
},
"reach": {
"description": "The total number of unique accounts that have seen the user's content.",
"type": ["null", "integer"]
},
"text_message_clicks": {
"description": "The number of clicks to send text messages to the user.",
"type": ["null", "integer"]
},
"website_clicks": {
"description": "The number of clicks on the website link in the user's profile.",
"type": ["null", "integer"]
},
"impressions_week": {
"description": "The total number of impressions in the last week.",
"type": ["null", "integer"]
Expand All @@ -66,10 +46,6 @@
"online_followers": {
"description": "The number of followers who are currently online.",
"type": ["null", "object"]
},
"email_contacts": {
"description": "The number of email contacts associated with the user's account.",
"type": ["null", "integer"]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,9 @@ class UserInsights(DatetimeTransformerMixin, InstagramIncrementalStream):

METRICS_BY_PERIOD = {
"day": [
"email_contacts",
"follower_count",
"get_directions_clicks",
"impressions",
"phone_call_clicks",
"profile_views",
"reach",
"text_message_clicks",
"website_clicks",
],
"week": ["impressions", "reach"],
"days_28": ["impressions", "reach"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
GENERAL_MEDIA: MEDIA_ID_GENERAL_MEDIA,
}

METRICS_GENERAL_MEDIA = ["impressions", "reach", "saved", "video_views", "likes", "comments", "shares", "follows", "profile_visits"]
METRICS_GENERAL_MEDIA = ["impressions", "reach", "saved", "likes", "comments", "shares", "follows", "profile_visits"]

_METRICS = {
MEDIA_ID_REELS: [
Expand All @@ -89,9 +89,9 @@
"ig_reels_aggregated_all_plays_count",
"clips_replays_count",
],
MEDIA_ID_VIDEO_FEED: ["impressions", "reach", "saved", "video_views"],
MEDIA_ID_VIDEO: ["impressions", "reach", "saved", "video_views", "likes", "comments", "shares", "follows", "profile_visits"],
MEDIA_ID_CAROUSEL_ALBUM: ["impressions", "reach", "saved", "video_views", "shares", "follows", "profile_visits"],
MEDIA_ID_VIDEO_FEED: ["impressions", "reach", "saved"],
MEDIA_ID_VIDEO: ["impressions", "reach", "saved", "likes", "comments", "shares", "follows", "profile_visits"],
MEDIA_ID_CAROUSEL_ALBUM: ["impressions", "reach", "saved", "shares", "follows", "profile_visits"],
MEDIA_ID_GENERAL_MEDIA: METRICS_GENERAL_MEDIA,
# Reusing general media metrics for error scenarios
MEDIA_ID_ERROR_POSTED_BEFORE_BUSINESS: METRICS_GENERAL_MEDIA,
Expand Down
Loading

0 comments on commit 9dd5283

Please sign in to comment.