|
1 | 1 | import logging |
2 | 2 | import time |
3 | | -import jsonpatch |
4 | 3 |
|
5 | | -from globus_sdk import ClientCredentialsAuthorizer, ConfidentialAppAuthClient, SearchClient |
| 4 | +import jsonpatch |
| 5 | +from globus_sdk import (ClientCredentialsAuthorizer, ConfidentialAppAuthClient, |
| 6 | + SearchClient) |
6 | 7 | from globus_sdk.scopes import SearchScopes |
7 | 8 | from globus_sdk.services.search.errors import SearchAPIError |
8 | 9 |
|
@@ -69,7 +70,9 @@ def ingest(self, messages_data): |
69 | 70 | def post(self, message_data): |
70 | 71 | item = message_data.get("data").get("payload").get("item") |
71 | 72 | try: |
72 | | - globus_response = self.search_client.get_subject(self.esgf_index, item.get("id")) |
| 73 | + globus_response = self.search_client.get_subject( |
| 74 | + self.esgf_index, item.get("id") |
| 75 | + ) |
73 | 76 | except SearchAPIError as e: |
74 | 77 | if e.http_status == 404: |
75 | 78 | item["assets"] = self.convert_assets(item.get("assets")) |
@@ -99,7 +102,9 @@ def json_patch(self, message_data): |
99 | 102 | value=f"Item with ID {item_id} does not exist in the index.", |
100 | 103 | ) |
101 | 104 | return None |
102 | | - gmeta_entry = jsonpatch.apply_patch(globus_response.data.get("content"), payload.get("patch")) |
| 105 | + gmeta_entry = jsonpatch.apply_patch( |
| 106 | + globus_response.data.get("content"), payload.get("patch") |
| 107 | + ) |
103 | 108 | return gmeta_entry |
104 | 109 |
|
105 | 110 | def delete(self, subject): |
|
0 commit comments