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

source-jira-native: skip fetching child resources of deleted projects (additional streams) #2398

Merged
merged 1 commit into from
Feb 13, 2025
Merged
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
14 changes: 13 additions & 1 deletion source-jira-native/source_jira_native/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -1015,6 +1015,10 @@ def parse_response(self, response: requests.Response, **kwargs) -> Iterable[Mapp

def read_records(self, stream_slice: Optional[Mapping[str, Any]] = None, **kwargs) -> Iterable[Mapping[str, Any]]:
for project in read_full_refresh(self.projects_stream):
# Skip fetching child resources for deleted projects since attempting to do so will return a 404 error.
if project.get('deleted', None):
continue

yield from super().read_records(stream_slice={"key": project["key"]}, **kwargs)


Expand Down Expand Up @@ -1049,6 +1053,10 @@ def path(self, stream_slice: Mapping[str, Any], **kwargs) -> str:

def read_records(self, stream_slice: Optional[Mapping[str, Any]] = None, **kwargs) -> Iterable[Mapping[str, Any]]:
for project in read_full_refresh(self.projects_stream):
# Skip fetching child resources for deleted projects since attempting to do so will return a 404 error.
if project.get('deleted', None):
continue

yield from super().read_records(stream_slice={"key": project["key"]}, **kwargs)


Expand Down Expand Up @@ -1100,6 +1108,10 @@ def path(self, stream_slice: Mapping[str, Any], **kwargs) -> str:

def read_records(self, stream_slice: Optional[Mapping[str, Any]] = None, **kwargs) -> Iterable[Mapping[str, Any]]:
for project in read_full_refresh(self.projects_stream):
# Skip fetching child resources for deleted projects since attempting to do so will return a 404 error.
if project.get('deleted', None):
continue

yield from super().read_records(stream_slice={"key": project["key"]}, **kwargs)

def transform(self, record: MutableMapping[str, Any], stream_slice: Mapping[str, Any], **kwargs) -> MutableMapping[str, Any]:
Expand Down Expand Up @@ -1152,7 +1164,7 @@ def path(self, stream_slice: Mapping[str, Any], **kwargs) -> str:

def read_records(self, stream_slice: Optional[Mapping[str, Any]] = None, **kwargs) -> Iterable[Mapping[str, Any]]:
for project in read_full_refresh(self.projects_stream):
# Skip fetching emails for deleted projects since attempting to do so will return a 404 error.
# Skip fetching child resources for deleted projects since attempting to do so will return a 404 error.
if project.get('deleted', None):
continue

Expand Down
Loading