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

Remove unavailable fields and replace with alternatives as necessary #16

Merged
merged 2 commits into from
Jan 3, 2024
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
54 changes: 27 additions & 27 deletions tap_instagram/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ def _metrics_for_media_type(media_type: str, media_product_type: str):
]
else: # media_product_type is "AD" or "FEED"
metrics = [
"engagement",
"total_interactions",
"impressions",
"reach",
"saved",
Expand All @@ -482,11 +482,11 @@ def _metrics_for_media_type(media_type: str, media_product_type: str):
return metrics
elif media_type == "CAROUSEL_ALBUM":
return [
"carousel_album_engagement",
"carousel_album_impressions",
"carousel_album_reach",
"carousel_album_saved",
"carousel_album_video_views",
"total_interactions",
"impressions",
"reach",
"saved",
"video_views",
]
else:
raise ValueError(
Expand Down Expand Up @@ -629,16 +629,16 @@ def _metrics_for_media_type(media_type: str, media_product_type: str):
if media_type in ("IMAGE", "VIDEO"):
if media_product_type == "STORY":
return [
"exits",
# "exits",
"impressions",
"reach",
"replies",
"taps_forward",
"taps_back",
# "taps_forward",
# "taps_back",
]
else: # media_product_type is "AD" or "FEED"
metrics = [
"engagement",
"total_interactions",
"impressions",
"reach",
"saved",
Expand All @@ -648,11 +648,11 @@ def _metrics_for_media_type(media_type: str, media_product_type: str):
return metrics
elif media_type == "CAROUSEL_ALBUM":
return [
"carousel_album_engagement",
"carousel_album_impressions",
"carousel_album_reach",
"carousel_album_saved",
"carousel_album_video_views",
"total_interactions",
"impressions",
"reach",
"saved",
"video_views",
]
else:
raise ValueError(
Expand Down Expand Up @@ -872,18 +872,18 @@ class UserInsightsOnlineFollowersStream(UserInsightsStream):
# TODO: Add note about online_followers seemingly only going back 30 days


class UserInsightsAudienceStream(UserInsightsStream):
"""Define custom stream."""

name = "user_insights_audience"
metrics = [
"audience_city",
"audience_country",
"audience_gender_age",
"audience_locale",
]
time_period = "lifetime"
has_pagination = False
# class UserInsightsAudienceStream(UserInsightsStream):
# """Define custom stream."""
#
# name = "user_insights_audience"
# metrics = [
# "audience_city",
# "audience_country",
# "audience_gender_age",
# "audience_locale",
# ]
# time_period = "lifetime"
# has_pagination = False


class UserInsightsFollowersStream(UserInsightsStream):
Expand Down
2 changes: 0 additions & 2 deletions tap_instagram/tap.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
StoriesStream,
StoryInsightsStream,
UserInsights28DayStream,
UserInsightsAudienceStream,
UserInsightsDailyStream,
UserInsightsFollowersStream,
UserInsightsOnlineFollowersStream,
Expand All @@ -28,7 +27,6 @@
StoriesStream,
StoryInsightsStream,
UserInsights28DayStream,
UserInsightsAudienceStream,
UserInsightsDailyStream,
UserInsightsFollowersStream,
UserInsightsOnlineFollowersStream,
Expand Down
Loading