prakhar_srivastava
09/19/2023, 1:31 PMtap-jira. While the parent stream gets the unique records, the child stream is fetching duplicate records. How can I tackle this?Reuben (Matatika)
09/19/2023, 1:46 PMprakhar_srivastava
09/20/2023, 8:46 AMReuben (Matatika)
09/20/2023, 8:56 AMparse_response if the parent or child stream is erroneously returning multiple records of the same ID - although you might want to consider why this is happening (e.g. is the API response wrong, is a comment with the same ID as another an edit of the same comment).prakhar_srivastava
09/20/2023, 9:02 AMReuben (Matatika)
09/20/2023, 9:02 AMprakhar_srivastava
09/20/2023, 9:04 AMclass IssueComments(JiraStream):
"""
<https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-comments/#api-rest-api-3-issue-issueidorkey-comment-get>
"""
"""
name: stream name
path: path which will be added to api url in client.py
schema: instream schema
primary_keys = primary keys for the table
replication_key = datetime keys for replication
records_jsonpath = json response body
"""
name = "issue_comments"
parent_stream_type = IssueStream
ignore_parent_replication_keys = True
path = "/issue/{issue_id}/comment"
primary_keys = ["id"]
records_jsonpath = "$[comments][*]"
instance_name = "comments"
schema = PropertiesList(
Property("id", StringType),
Property("issueId", StringType),
Property("self", StringType),
Property(
"author",
ObjectType(
Property("accountId", StringType),
Property("self", StringType),
Property("displayName", StringType),
Property("active", BooleanType),
),
),
Property("created", DateTimeType),
Property("updated", DateTimeType),
Property(
"body",
ObjectType(
Property("type", StringType),
Property("version", IntegerType),
Property(
"content",
ArrayType(
ObjectType(
Property("type", StringType),
Property(
"content",
ArrayType(
ObjectType(
Property("type", StringType),
Property("text", StringType),
)
),
),
)
),
),
),
),
Property(
"updateAuthor",
ObjectType(
Property("accountId", StringType),
Property("self", StringType),
Property("displayName", StringType),
Property("active", BooleanType),
),
),
).to_dict()
def post_process(self, row:dict, context:dict) -> dict:
row["issueId"] = context["issue_id"]
return rowprakhar_srivastava
09/20/2023, 9:10 AMprakhar_srivastava
09/20/2023, 9:13 AMprakhar_srivastava
09/20/2023, 9:14 AMReuben (Matatika)
09/20/2023, 9:19 AMJiraStream implementation too?prakhar_srivastava
09/20/2023, 9:25 AMprakhar_srivastava
09/20/2023, 9:26 AMReuben (Matatika)
09/20/2023, 9:34 AMget_next_page_token logic is causing the increasing duplication. I would have a look into that in more detail.prakhar_srivastava
09/20/2023, 9:34 AMprakhar_srivastava
09/20/2023, 9:34 AMReuben (Matatika)
09/20/2023, 9:41 AMprakhar_srivastava
09/20/2023, 9:50 AMprakhar_srivastava
09/20/2023, 9:52 AMprakhar_srivastava
09/20/2023, 9:53 AMReuben (Matatika)
09/20/2023, 10:11 AM