Skip to content

Commit

Permalink
Update traffic_* streams to use selected_by_default #212
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentS committed Jul 21, 2023
1 parent 46b5cf2 commit 5001367
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions tap_github/repository_streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -2299,17 +2299,6 @@ def query(self) -> str:
class TrafficRestStream(GitHubRestStream):
"""Base class for Traffic Streams"""

@property
def metadata(self):
"""Override default selection metadata for this stream.
TODO: Remove this in favor of the recommended approach when the SDK has one.
"""
result = super().metadata
if self._tap_input_catalog is None:
result.root.selected = False
return result

def parse_response(self, response: requests.Response) -> Iterable[dict]:
if response.status_code != 200:
return []
Expand Down Expand Up @@ -2341,6 +2330,7 @@ class TrafficClonesStream(TrafficRestStream):
ignore_parent_replication_key = True
state_partitioning_keys = ["repo", "org"]
records_jsonpath = "$.clones[*]"
selected_by_default = False

schema = th.PropertiesList(
# Parent keys
Expand All @@ -2365,6 +2355,7 @@ class TrafficReferralPathsStream(TrafficRestStream):
ignore_parent_replication_key = True
state_partitioning_keys = ["repo", "org"]
records_jsonpath = "[*]"
selected_by_default = False

schema = th.PropertiesList(
# Parent keys
Expand All @@ -2390,6 +2381,7 @@ class TrafficReferrersStream(TrafficRestStream):
ignore_parent_replication_key = True
state_partitioning_keys = ["repo", "org"]
records_jsonpath = "[*]"
selected_by_default = False

schema = th.PropertiesList(
# Parent keys
Expand All @@ -2414,6 +2406,7 @@ class TrafficPageViewsStream(TrafficRestStream):
ignore_parent_replication_key = True
state_partitioning_keys = ["repo", "org"]
records_jsonpath = "$.views[*]"
selected_by_default = False

schema = th.PropertiesList(
# Parent keys
Expand Down

0 comments on commit 5001367

Please sign in to comment.