Skip to content

Commit

Permalink
Merge pull request #2 from prratek/logging-frequency
Browse files Browse the repository at this point in the history
Reduce state and logging frequency
  • Loading branch information
prratek authored Feb 19, 2022
2 parents cdbb845 + 091a31f commit 017b860
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "tap-instagram"
version = "0.1.4"
version = "0.2.0"
description = "`tap-instagram` is a Singer tap for Instagram, built with the Meltano SDK for Singer Taps."
authors = ["Prratek Ramchandani"]
keywords = [
Expand Down
4 changes: 4 additions & 0 deletions tap_instagram/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ def get_url_params(

def get_child_context(self, record: dict, context: Optional[dict]) -> dict:
return {
"user_id": context["user_id"],
"media_id": record["id"],
"media_type": record["media_type"],
}
Expand All @@ -218,6 +219,7 @@ class MediaChildrenStream(BaseMediaStream):

name = "media_children"
parent_stream_type = MediaStream
state_partitioning_keys = ["user_id"]
path = "/{media_id}/children" # media_id is populated using child context keys from MediaStream
# caption, comments_count, is_comment_enabled, like_count, media_product_type, video_title
# not available on album children
Expand Down Expand Up @@ -368,6 +370,7 @@ class MediaInsightsStream(BaseMediaInsightsStream):

name = "media_insights"
parent_stream_type = MediaStream
state_partitioning_keys = ["user_id"]


# Insights not available for children media objects
Expand All @@ -383,6 +386,7 @@ class StoryInsightsStream(BaseMediaInsightsStream):

name = "story_insights"
parent_stream_type = StoriesStream
state_partitioning_keys = ["user_id"]


class UserInsightsStream(InstagramStream):
Expand Down
5 changes: 5 additions & 0 deletions tap_instagram/tap.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ class TapInstagram(Tap):
th.DateTimeType,
description="The earliest record date to sync",
),
th.Property(
"metrics_log_level",
th.StringType,
description="A user access token",
),
).to_dict()

@property
Expand Down

0 comments on commit 017b860

Please sign in to comment.