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

fix: Use updated as the replication key for the issues stream #71

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
10 changes: 7 additions & 3 deletions tap_jira/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ class IssueStream(JiraStream):
name = "issues"
path = "/search"
primary_keys = ["id"]
replication_key = "id"
replication_key = "updated"
replication_method = "INCREMENTAL"
records_jsonpath = "$[issues][*]" # Or override `parse_response`.
instance_name = "issues"
Expand Down Expand Up @@ -2316,8 +2316,9 @@ def get_child_context(self, record: dict, context: Optional[dict]) -> dict:
"""Return a context dictionary for child streams."""
return {"issue_id": record["id"]}

def post_process(self, row: dict, context: dict | None = None) -> dict | None:
# dafault value for array, would remove once handled at SDK level
def post_process(self, row: dict, context: dict | None = None) -> dict | None: # noqa: ARG002
"""Post process each row before returning to the SDK."""
# default value for array, would remove once handled at SDK level
for key_set_default in [
"customfield_10010",
"customfield_10005",
Expand Down Expand Up @@ -2346,6 +2347,9 @@ def post_process(self, row: dict, context: dict | None = None) -> dict | None:
]:
if row["fields"].get(key_set_default) is None:
row["fields"][key_set_default] = []

row["created"] = row["fields"].get("created")
row["updated"] = row["fields"].get("updated")
return row


Expand Down
Loading