Skip to content

Commit

Permalink
After review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mpolomdeepsense committed Feb 26, 2025
1 parent ce74a38 commit 29d923b
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
"board_id": null,
"project_id": "JCTP1"
},
"date_created": null,
"date_modified": null,
"date_processed": "1740409356.9567373",
"date_created": "2023-08-22T11:29:37.774+0000",
"date_modified": "2025-02-21T13:25:46.017+0000",
"date_processed": "1740557828.4891825",
"permissions_data": null,
"filesize_bytes": null
},
Expand All @@ -28,6 +28,6 @@
"project_id": "JCTP1"
},
"reprocess": false,
"local_download_path": "/tmp/tmpj2ak4ry3/JCTP1/10000.txt",
"display_name": null
"local_download_path": "/tmp/tmpqyce024l/JCTP1/10000.txt",
"display_name": "Jira Connector Test Project 1"
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
"board_id": null,
"project_id": "JCTP1"
},
"date_created": null,
"date_modified": null,
"date_processed": "1740409357.6608434",
"date_created": "2023-08-22T11:29:43.033+0000",
"date_modified": "2023-08-24T12:03:31.591+0000",
"date_processed": "1740557829.0142515",
"permissions_data": null,
"filesize_bytes": null
},
Expand All @@ -28,6 +28,6 @@
"project_id": "JCTP1"
},
"reprocess": false,
"local_download_path": "/tmp/tmpj2ak4ry3/JCTP1/10001.txt",
"display_name": null
"local_download_path": "/tmp/tmpqyce024l/JCTP1/10001.txt",
"display_name": "Jira Connector Test Project 1"
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
"board_id": null,
"project_id": "JCTP1"
},
"date_created": null,
"date_modified": null,
"date_processed": "1740409358.2943182",
"date_created": "2023-08-22T11:29:46.189+0000",
"date_modified": "2023-08-23T14:36:31.252+0000",
"date_processed": "1740557829.5562248",
"permissions_data": null,
"filesize_bytes": null
},
Expand All @@ -28,6 +28,6 @@
"project_id": "JCTP1"
},
"reprocess": false,
"local_download_path": "/tmp/tmpj2ak4ry3/JCTP1/10002.txt",
"display_name": null
"local_download_path": "/tmp/tmpqyce024l/JCTP1/10002.txt",
"display_name": "Jira Connector Test Project 1"
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
"board_id": null,
"project_id": "JCTP2"
},
"date_created": null,
"date_modified": null,
"date_processed": "1740409359.4585",
"date_created": "2023-08-22T11:32:09.040+0000",
"date_modified": "2023-09-29T05:55:11.447+0000",
"date_processed": "1740557830.5772882",
"permissions_data": null,
"filesize_bytes": null
},
Expand All @@ -28,6 +28,6 @@
"project_id": "JCTP2"
},
"reprocess": false,
"local_download_path": "/tmp/tmpj2ak4ry3/JCTP2/10003.txt",
"display_name": null
"local_download_path": "/tmp/tmpqyce024l/JCTP2/10003.txt",
"display_name": "Jira Connector Test Project 2"
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
"board_id": null,
"project_id": "JCTP2"
},
"date_created": null,
"date_modified": null,
"date_processed": "1740409360.0712829",
"date_created": "2023-08-22T11:32:15.109+0000",
"date_modified": "2023-09-29T05:55:11.351+0000",
"date_processed": "1740557831.0480325",
"permissions_data": null,
"filesize_bytes": null
},
Expand All @@ -28,6 +28,6 @@
"project_id": "JCTP2"
},
"reprocess": false,
"local_download_path": "/tmp/tmpj2ak4ry3/JCTP2/10004.txt",
"display_name": null
"local_download_path": "/tmp/tmpqyce024l/JCTP2/10004.txt",
"display_name": "Jira Connector Test Project 2"
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
"board_id": null,
"project_id": "JCTP2"
},
"date_created": null,
"date_modified": null,
"date_processed": "1740409360.680108",
"date_created": "2023-08-22T11:32:18.249+0000",
"date_modified": "2023-08-22T11:32:21.717+0000",
"date_processed": "1740557831.571495",
"permissions_data": null,
"filesize_bytes": null
},
Expand All @@ -28,6 +28,6 @@
"project_id": "JCTP2"
},
"reprocess": false,
"local_download_path": "/tmp/tmpj2ak4ry3/JCTP2/10005.txt",
"display_name": null
"local_download_path": "/tmp/tmpqyce024l/JCTP2/10005.txt",
"display_name": "Jira Connector Test Project 2"
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
"board_id": null,
"project_id": "JCTP1"
},
"date_created": null,
"date_modified": null,
"date_processed": "1740409358.8760052",
"date_created": "2023-08-24T12:04:35.328+0000",
"date_modified": "2023-08-24T12:04:47.543+0000",
"date_processed": "1740557830.0545702",
"permissions_data": null,
"filesize_bytes": null
},
Expand All @@ -28,6 +28,6 @@
"project_id": "JCTP1"
},
"reprocess": false,
"local_download_path": "/tmp/tmpj2ak4ry3/JCTP1/10013.txt",
"display_name": null
"local_download_path": "/tmp/tmpqyce024l/JCTP1/10013.txt",
"display_name": "Jira Connector Test Project 1"
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
"board_id": "3",
"project_id": "JCTP3"
},
"date_created": null,
"date_modified": null,
"date_processed": "1740409356.3731556",
"date_created": "2023-08-24T13:38:35.057+0000",
"date_modified": "2023-08-24T13:39:02.055+0000",
"date_processed": "1740557828.0832858",
"permissions_data": null,
"filesize_bytes": null
},
Expand All @@ -28,6 +28,6 @@
"project_id": "JCTP3"
},
"reprocess": false,
"local_download_path": "/tmp/tmpj2ak4ry3/JCTP3/10014.txt",
"display_name": null
"local_download_path": "/tmp/tmpqyce024l/JCTP3/10014.txt",
"display_name": "Jira Connector Test Project 3 - Company Managed Project"
}
16 changes: 10 additions & 6 deletions unstructured_ingest/v2/processes/connectors/jira.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,17 @@ def __getitem__(self, key):
return value


def nested_object_to_field_getter(object: dict) -> Union[FieldGetter, dict]:
if isinstance(object, abc.Mapping):
def nested_object_to_field_getter(obj: dict) -> Union[FieldGetter, dict]:
if isinstance(obj, abc.Mapping):
new_object = {}
for k, v in object.items():
for k, v in obj.items():
if isinstance(v, abc.Mapping):
new_object[k] = FieldGetter(nested_object_to_field_getter(v))
else:
new_object[k] = v
return FieldGetter(new_object)
else:
return object
return obj


def issues_fetcher_wrapper(func, results_key="results", number_of_issues_to_fetch: int = 100):
Expand Down Expand Up @@ -401,7 +401,11 @@ def _get_fields_for_comment(
return f"{comment['author']['displayName']}{c_sep}{comment['body']}{r_sep}"

def form_templated_string(
self, issue: dict, parsed_fields, c_sep: str = "|||", r_sep: str = "\n\n\n"
self,
issue: dict,
parsed_fields: Union[FieldGetter, dict],
c_sep: str = "|||",
r_sep: str = "\n\n\n",
) -> str:
"""Forms a template string via parsing the fields from the API response object on the issue
The template string will be saved to the disk, and then will be processed by partition."""
Expand Down Expand Up @@ -444,7 +448,7 @@ def run(self, file_data: FileData, **kwargs: Any) -> DownloadResponse:
download_path.parent.mkdir(parents=True, exist_ok=True)
with open(download_path, "w") as f:
f.write(issue_str)

self.update_file_data(file_data, issue)
return self.generate_download_response(file_data=file_data, download_path=download_path)


Expand Down

0 comments on commit 29d923b

Please sign in to comment.