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: Remove deprecated metrics for media_insights and user_insights #51018

Merged
merged 4 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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": {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably not useful because the media_insights stream uses the schema inlined in the manifest but I updated both just in case

"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
Loading