synapse-sdk 2025.10.3__py3-none-any.whl → 2025.10.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of synapse-sdk might be problematic. Click here for more details.

Files changed (17) hide show
  1. synapse_sdk/devtools/docs/docs/plugins/categories/pre-annotation-plugins/pre-annotation-plugin-overview.md +198 -0
  2. synapse_sdk/devtools/docs/docs/plugins/categories/pre-annotation-plugins/to-task-action-development.md +1645 -0
  3. synapse_sdk/devtools/docs/docs/plugins/categories/pre-annotation-plugins/to-task-overview.md +717 -0
  4. synapse_sdk/devtools/docs/docs/plugins/categories/pre-annotation-plugins/to-task-template-development.md +1380 -0
  5. synapse_sdk/devtools/docs/i18n/ko/docusaurus-plugin-content-docs/current/plugins/categories/pre-annotation-plugins/pre-annotation-plugin-overview.md +198 -0
  6. synapse_sdk/devtools/docs/i18n/ko/docusaurus-plugin-content-docs/current/plugins/categories/pre-annotation-plugins/to-task-action-development.md +1645 -0
  7. synapse_sdk/devtools/docs/i18n/ko/docusaurus-plugin-content-docs/current/plugins/categories/pre-annotation-plugins/to-task-overview.md +717 -0
  8. synapse_sdk/devtools/docs/i18n/ko/docusaurus-plugin-content-docs/current/plugins/categories/pre-annotation-plugins/to-task-template-development.md +1380 -0
  9. synapse_sdk/devtools/docs/sidebars.ts +14 -0
  10. synapse_sdk/plugins/categories/export/actions/export/action.py +8 -3
  11. synapse_sdk/plugins/categories/export/actions/export/utils.py +108 -8
  12. {synapse_sdk-2025.10.3.dist-info → synapse_sdk-2025.10.4.dist-info}/METADATA +1 -1
  13. {synapse_sdk-2025.10.3.dist-info → synapse_sdk-2025.10.4.dist-info}/RECORD +17 -9
  14. {synapse_sdk-2025.10.3.dist-info → synapse_sdk-2025.10.4.dist-info}/WHEEL +0 -0
  15. {synapse_sdk-2025.10.3.dist-info → synapse_sdk-2025.10.4.dist-info}/entry_points.txt +0 -0
  16. {synapse_sdk-2025.10.3.dist-info → synapse_sdk-2025.10.4.dist-info}/licenses/LICENSE +0 -0
  17. {synapse_sdk-2025.10.3.dist-info → synapse_sdk-2025.10.4.dist-info}/top_level.txt +0 -0
@@ -54,6 +54,20 @@ const sidebars: SidebarsConfig = {
54
54
  'plugins/categories/upload-plugins/upload-plugin-template',
55
55
  ],
56
56
  },
57
+ {
58
+ type: 'category',
59
+ label: 'Pre-annotation Plugins',
60
+ link: {
61
+ type: 'doc',
62
+ id: 'plugins/categories/pre-annotation-plugins/pre-annotation-plugin-overview',
63
+ },
64
+ items: [
65
+ 'plugins/categories/pre-annotation-plugins/pre-annotation-plugin-overview',
66
+ 'plugins/categories/pre-annotation-plugins/to-task-overview',
67
+ 'plugins/categories/pre-annotation-plugins/to-task-action-development',
68
+ 'plugins/categories/pre-annotation-plugins/to-task-template-development',
69
+ ],
70
+ },
57
71
  ],
58
72
  },
59
73
  {
@@ -95,11 +95,11 @@ class ExportAction(Action):
95
95
  PydanticCustomError: If data retrieval fails
96
96
  """
97
97
  try:
98
- result_list = handler.get_results(self.client, filters)
98
+ result_list = handler.get_results(self.client, filters, run=self.run)
99
99
  results = result_list[0]
100
100
  count = result_list[1]
101
101
  except ClientError:
102
- raise PydanticCustomError('client_error', _('Unable to get Ground Truth dataset.'))
102
+ raise PydanticCustomError('client_error', _('Unable to get dataset.'))
103
103
  return results, count
104
104
 
105
105
  def start(self) -> Dict[str, Any]:
@@ -116,7 +116,12 @@ class ExportAction(Action):
116
116
  """
117
117
  self.run.log_message_with_code(LogCode.EXPORT_STARTED)
118
118
 
119
- filters = {'expand': 'data', **self.params['filter']}
119
+ # Get expand setting from config, default to True (expand data)
120
+ filters = {**self.params['filter']}
121
+ data_expand = self.config.get('data_expand', True)
122
+ if data_expand:
123
+ filters['expand'] = 'data'
124
+
120
125
  target = self.params['target']
121
126
  handler = TargetHandlerFactory.get_handler(target)
122
127
 
@@ -1,10 +1,12 @@
1
1
  from abc import ABC, abstractmethod
2
- from typing import Any
2
+ from typing import Any, Optional
3
+ import time
3
4
 
4
5
  from pydantic_core import PydanticCustomError
5
6
 
6
7
  from synapse_sdk.clients.exceptions import ClientError
7
8
  from synapse_sdk.i18n import gettext as _
9
+ from synapse_sdk.shared.enums import Context
8
10
 
9
11
 
10
12
  class ExportTargetHandler(ABC):
@@ -15,6 +17,103 @@ class ExportTargetHandler(ABC):
15
17
  of methods to validate filters, retrieve results, and process collections of results.
16
18
  """
17
19
 
20
+ # TODO: This is a temporary workaround and needs improvement in the future
21
+ def _get_results_chunked(self, list_method, filters, chunk_size=100, max_retries=3, retry_delay=1, run=None):
22
+ """
23
+ Retrieve results in chunks to avoid memory and response size limits.
24
+
25
+ Args:
26
+ list_method: The client method to call (e.g., client.list_assignments)
27
+ filters (dict): The filter criteria to apply
28
+ chunk_size (int): Number of items to fetch per chunk
29
+ max_retries (int): Maximum number of retries for failed requests
30
+ retry_delay (int): Delay in seconds between retries
31
+
32
+ Returns:
33
+ tuple: A tuple containing the results generator and the total count
34
+ """
35
+ filters = filters.copy()
36
+ filters['page_size'] = chunk_size
37
+
38
+ page = 1
39
+ results = []
40
+ total_count = 0
41
+
42
+ try:
43
+ while True:
44
+ filters['page'] = page
45
+
46
+ # Retry logic for handling temporary server issues
47
+ for attempt in range(max_retries + 1):
48
+ try:
49
+ response = list_method(params=filters, list_all=False)
50
+ break
51
+ except ClientError as e:
52
+ error_msg = str(e)
53
+
54
+ # Use log_dev_event for better debugging and monitoring
55
+ if run:
56
+ run.log_dev_event(
57
+ 'Chunked data retrieval error',
58
+ {
59
+ 'page': page,
60
+ 'attempt': attempt + 1,
61
+ 'error_message': error_msg,
62
+ 'chunk_size': chunk_size,
63
+ },
64
+ level=Context.WARNING,
65
+ )
66
+
67
+ # Check for JSON decode errors specifically
68
+ if 'Expecting value' in error_msg or 'JSONDecodeError' in error_msg:
69
+ if run:
70
+ run.log_dev_event(
71
+ 'JSON parsing error - skipping page',
72
+ {'page': page, 'error_type': 'JSON_DECODE_ERROR', 'error_details': error_msg},
73
+ level=Context.DANGER,
74
+ )
75
+ # Skip this page and continue with next
76
+ page += 1
77
+ break
78
+ elif attempt < max_retries and ('503' in error_msg or 'connection' in error_msg.lower()):
79
+ retry_delay_seconds = retry_delay * (2**attempt)
80
+ if run:
81
+ run.log_dev_event(
82
+ 'Server issue - retrying with backoff',
83
+ {
84
+ 'page': page,
85
+ 'retry_attempt': attempt + 1,
86
+ 'max_retries': max_retries,
87
+ 'retry_delay_seconds': retry_delay_seconds,
88
+ 'error_type': 'SERVER_ISSUE',
89
+ },
90
+ level=Context.INFO,
91
+ )
92
+ time.sleep(retry_delay_seconds) # Exponential backoff
93
+ continue
94
+ else:
95
+ raise
96
+
97
+ if page == 1:
98
+ total_count = response['count']
99
+
100
+ current_results = response.get('results', [])
101
+ results.extend(current_results)
102
+
103
+ # Check if we've got all results or if there are no more results
104
+ if len(current_results) < chunk_size or not response.get('next'):
105
+ break
106
+
107
+ page += 1
108
+
109
+ # Small delay between pages to avoid overwhelming the server
110
+ time.sleep(0.1)
111
+
112
+ return results, total_count
113
+ except Exception:
114
+ # Re-raise the exception to be handled by the calling method
115
+ raise
116
+
18
117
  @abstractmethod
19
118
  def validate_filter(self, value: dict, client: Any):
20
119
  """
@@ -33,13 +132,14 @@ class ExportTargetHandler(ABC):
33
132
  pass
34
133
 
35
134
  @abstractmethod
36
- def get_results(self, client: Any, filters: dict):
135
+ def get_results(self, client: Any, filters: dict, run=None):
37
136
  """
38
137
  Retrieve original data from target sources.
39
138
 
40
139
  Args:
41
140
  client (Any): The client used to retrieve the results.
42
141
  filters (dict): The filter criteria to apply.
142
+ run: Optional ExportRun instance for logging.
43
143
 
44
144
  Returns:
45
145
  tuple: A tuple containing the results and the total count of results.
@@ -76,8 +176,8 @@ class AssignmentExportTargetHandler(ExportTargetHandler):
76
176
  raise PydanticCustomError('client_error', _('Unable to get Assignment.'))
77
177
  return value
78
178
 
79
- def get_results(self, client: Any, filters: dict):
80
- return client.list_assignments(params=filters, list_all=True)
179
+ def get_results(self, client: Any, filters: dict, run=None):
180
+ return self._get_results_chunked(client.list_assignments, filters, run=run)
81
181
 
82
182
  def get_export_item(self, results):
83
183
  for result in results:
@@ -104,9 +204,9 @@ class GroundTruthExportTargetHandler(ExportTargetHandler):
104
204
  raise PydanticCustomError('client_error', _('Unable to get Ground Truth dataset version.'))
105
205
  return value
106
206
 
107
- def get_results(self, client: Any, filters: dict):
207
+ def get_results(self, client: Any, filters: dict, run=None):
108
208
  filters['ground_truth_dataset_versions'] = filters.pop('ground_truth_dataset_version')
109
- return client.list_ground_truth_events(params=filters, list_all=True)
209
+ return self._get_results_chunked(client.list_ground_truth_events, filters, run=run)
110
210
 
111
211
  def get_export_item(self, results):
112
212
  for result in results:
@@ -134,9 +234,9 @@ class TaskExportTargetHandler(ExportTargetHandler):
134
234
  raise PydanticCustomError('client_error', _('Unable to get Task.'))
135
235
  return value
136
236
 
137
- def get_results(self, client: Any, filters: dict):
237
+ def get_results(self, client: Any, filters: dict, run=None):
138
238
  filters['expand'] = ['data_unit', 'assignment', 'workshop']
139
- return client.list_tasks(params=filters, list_all=True)
239
+ return self._get_results_chunked(client.list_tasks, filters, run=run)
140
240
 
141
241
  def get_export_item(self, results):
142
242
  for result in results:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: synapse-sdk
3
- Version: 2025.10.3
3
+ Version: 2025.10.4
4
4
  Summary: synapse sdk
5
5
  Author-email: datamaker <developer@datamaker.io>
6
6
  License: MIT
@@ -53,7 +53,7 @@ synapse_sdk/devtools/docs/README.md,sha256=yBzWf0K1ef4oymFXDaHo0nYWEgMQJqsOyrkNh
53
53
  synapse_sdk/devtools/docs/docusaurus.config.ts,sha256=K1b002RS0x0tsOyib_6CSgUlASEULC9vAX8YDpbsRN4,3229
54
54
  synapse_sdk/devtools/docs/package-lock.json,sha256=dtepgbPC8gq5uz-hdcac4hIU-Cs209tX0sfBuB7RfEQ,705694
55
55
  synapse_sdk/devtools/docs/package.json,sha256=8veqayA4U3OLpdQaz6AzB59RQwTU-5soeYlYYWIxq28,1187
56
- synapse_sdk/devtools/docs/sidebars.ts,sha256=6MuXgPLBmk-URt37Jnv1uJjiL98xiqSCiHvu-utCXq4,2427
56
+ synapse_sdk/devtools/docs/sidebars.ts,sha256=A0LdvAgIBOfZTfcGcc7QI4pvEEYoC--7N1g2KZPkG8k,3031
57
57
  synapse_sdk/devtools/docs/tsconfig.json,sha256=O9BNlRPjPiaVHW2_boShMbmTnh0Z2k0KQO6Alf9FMVY,215
58
58
  synapse_sdk/devtools/docs/blog/2019-05-28-first-blog-post.md,sha256=iP7gl_FPqo-qX13lkSRcRoT6ayJNmCkXoyvlm7GH248,312
59
59
  synapse_sdk/devtools/docs/blog/2019-05-29-long-blog-post.md,sha256=cM-dhhTeurEWMcdn0Kx-NpNts2YUUraSI_XFk_gVHEE,3122
@@ -96,6 +96,10 @@ synapse_sdk/devtools/docs/docs/features/utils/storage.md,sha256=uIpc37trKUm4XHe1
96
96
  synapse_sdk/devtools/docs/docs/features/utils/types.md,sha256=l84J1Ooa40xBYdvK1YpeKBT9kaqaWQUMNIFPUiC2e_U,1046
97
97
  synapse_sdk/devtools/docs/docs/plugins/export-plugins.md,sha256=Wajf3CZRQiytRx6SS1lIBlGO5o4F2vOw-xog51JiHJU,37074
98
98
  synapse_sdk/devtools/docs/docs/plugins/plugins.md,sha256=G6y3XZZHuC65ApfKE0fYHCAC5TOFnZqzE7VR-KOExVk,25074
99
+ synapse_sdk/devtools/docs/docs/plugins/categories/pre-annotation-plugins/pre-annotation-plugin-overview.md,sha256=Dhnlqd7okB3SoOZ5RYRYqeBBZnGfctZrlCYo1A7GWyA,6832
100
+ synapse_sdk/devtools/docs/docs/plugins/categories/pre-annotation-plugins/to-task-action-development.md,sha256=itkXVOV-pZNsqX0PIA9YhCJNp8iNgxVdQvM0sVahHJ4,47810
101
+ synapse_sdk/devtools/docs/docs/plugins/categories/pre-annotation-plugins/to-task-overview.md,sha256=J-z2KkLt5WWTgbJGRxvqrZQxfHvur_QtCGA6iT5a0Og,17134
102
+ synapse_sdk/devtools/docs/docs/plugins/categories/pre-annotation-plugins/to-task-template-development.md,sha256=ARirm2jq5X2fVXWpZFX6ezh0aSIK5PCWvYC9nvsXIwY,41159
99
103
  synapse_sdk/devtools/docs/docs/plugins/categories/upload-plugins/upload-plugin-action.md,sha256=GmTZYLyPDuUC9WzjNjf_zNh5FkN-VYzLuSo_dQzewWw,30796
100
104
  synapse_sdk/devtools/docs/docs/plugins/categories/upload-plugins/upload-plugin-overview.md,sha256=E42ycC5Jfb19DBdLZ2QnCiABUuXkJW4a0ZEQwnXi2ZY,15740
101
105
  synapse_sdk/devtools/docs/docs/plugins/categories/upload-plugins/upload-plugin-template.md,sha256=HpqGQ9yUYy4673gkdPNsqFZRdAXnDv3xbrC87brG50o,22288
@@ -145,6 +149,10 @@ synapse_sdk/devtools/docs/i18n/ko/docusaurus-plugin-content-docs/current/feature
145
149
  synapse_sdk/devtools/docs/i18n/ko/docusaurus-plugin-content-docs/current/features/utils/types.md,sha256=JdDMC2FKovAU55pPEBoIUPPniU5mKAvA5w1Zb36u9AE,1207
146
150
  synapse_sdk/devtools/docs/i18n/ko/docusaurus-plugin-content-docs/current/plugins/export-plugins.md,sha256=XcvZuio6NUDuDSe_XhYq1ACDaAJThmekP3anEzOCRks,38804
147
151
  synapse_sdk/devtools/docs/i18n/ko/docusaurus-plugin-content-docs/current/plugins/plugins.md,sha256=wUuuOmQQY1dURZzJ0HSpiABaJWqKbxQn31Xfn-wUf8E,4947
152
+ synapse_sdk/devtools/docs/i18n/ko/docusaurus-plugin-content-docs/current/plugins/categories/pre-annotation-plugins/pre-annotation-plugin-overview.md,sha256=JlPxHFzeyXx0xi2vpGXc-GTkFeg9R-Smpap0OjCyE7g,7592
153
+ synapse_sdk/devtools/docs/i18n/ko/docusaurus-plugin-content-docs/current/plugins/categories/pre-annotation-plugins/to-task-action-development.md,sha256=UowD_fqWFVD81ubJKguX-O9fSf7L07i6Pft8DFdfVn0,48803
154
+ synapse_sdk/devtools/docs/i18n/ko/docusaurus-plugin-content-docs/current/plugins/categories/pre-annotation-plugins/to-task-overview.md,sha256=InL4EI0BkVXgjs-j7cPRYaRXDVxxMgBYYLs_9FdyKxk,18408
155
+ synapse_sdk/devtools/docs/i18n/ko/docusaurus-plugin-content-docs/current/plugins/categories/pre-annotation-plugins/to-task-template-development.md,sha256=Ab8EeSYMWZclb_qxvBaLaz4IdCXySrKN2o68s24VT6I,42441
148
156
  synapse_sdk/devtools/docs/i18n/ko/docusaurus-plugin-content-docs/current/plugins/categories/upload-plugins/upload-plugin-action.md,sha256=zaodG2yGwNQiPLrI59dhShB0WxZ1EMNdXnQx9E5Kzlk,32523
149
157
  synapse_sdk/devtools/docs/i18n/ko/docusaurus-plugin-content-docs/current/plugins/categories/upload-plugins/upload-plugin-overview.md,sha256=mcqq_bbC13KAgNZX6OUEbHxt03QhGMN9vF2MmU0WW-A,17111
150
158
  synapse_sdk/devtools/docs/i18n/ko/docusaurus-plugin-content-docs/current/plugins/categories/upload-plugins/upload-plugin-template.md,sha256=Rldxjo5DKmHfEBMoF86yLkgYGoip99gVkF7gBSkqNxM,23603
@@ -202,12 +210,12 @@ synapse_sdk/plugins/categories/data_validation/templates/plugin/validation.py,sh
202
210
  synapse_sdk/plugins/categories/export/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
203
211
  synapse_sdk/plugins/categories/export/actions/__init__.py,sha256=crCFQ3tTUFjI3UhszDBpsE7eYi7zpswSHjQgTh3tccI,61
204
212
  synapse_sdk/plugins/categories/export/actions/export/__init__.py,sha256=6y0WRhcqyhxbZIfbRCF0ZI6CQgqSXmqCRLP1hTkdBPc,727
205
- synapse_sdk/plugins/categories/export/actions/export/action.py,sha256=-jlPIkm8BGxouq6rr0Q8nBSCIFAGEmMOlmmbX4DZxYI,6125
213
+ synapse_sdk/plugins/categories/export/actions/export/action.py,sha256=hh1_to4xPmY6Dv-4Ge24oGbyj3J92Wy95Dl0XIaS36Q,6303
206
214
  synapse_sdk/plugins/categories/export/actions/export/enums.py,sha256=XO4CF8jWt0c9lcUenKcjaKb0iXqQBFLyVMHmLm2_Nv8,3601
207
215
  synapse_sdk/plugins/categories/export/actions/export/exceptions.py,sha256=cDXVQetJvSlTbijN3elNwDLACELn2UxjyGnM2ALlKOk,1753
208
216
  synapse_sdk/plugins/categories/export/actions/export/models.py,sha256=NM9mSJAhcFFREUVlCy1LRbmq4Tm8rH_FGyZimS2aXho,2779
209
217
  synapse_sdk/plugins/categories/export/actions/export/run.py,sha256=bmilGnxfMWtIIvdIoY9sHkCPkQf_1-myur10I5TUEFY,6912
210
- synapse_sdk/plugins/categories/export/actions/export/utils.py,sha256=rbqoOIcgAOjlHV9Vn-2czHk6nzsxQUNu_lJzjkU9XfM,6367
218
+ synapse_sdk/plugins/categories/export/actions/export/utils.py,sha256=rr-PajbTmFagVCDBJzPgeh34jgPzjW6eDwS70Wwp76o,10902
211
219
  synapse_sdk/plugins/categories/export/templates/config.yaml,sha256=fkbSPp7ISZ9NJ1Vvcz1dBSWoYjseVp1eJKyu5PPoboM,516
212
220
  synapse_sdk/plugins/categories/export/templates/plugin/__init__.py,sha256=oC8hczDebLaWoTaxANw0n9uMjVR5sydBs7pgTw78rbM,16057
213
221
  synapse_sdk/plugins/categories/export/templates/plugin/export.py,sha256=q9dbJIM3iCNu8W7J6HfIqQ5zeCx1QfyUaj7adhBvshI,6892
@@ -368,9 +376,9 @@ synapse_sdk/utils/storage/providers/gcp.py,sha256=i2BQCu1Kej1If9SuNr2_lEyTcr5M_n
368
376
  synapse_sdk/utils/storage/providers/http.py,sha256=2DhIulND47JOnS5ZY7MZUex7Su3peAPksGo1Wwg07L4,5828
369
377
  synapse_sdk/utils/storage/providers/s3.py,sha256=ZmqekAvIgcQBdRU-QVJYv1Rlp6VHfXwtbtjTSphua94,2573
370
378
  synapse_sdk/utils/storage/providers/sftp.py,sha256=_8s9hf0JXIO21gvm-JVS00FbLsbtvly4c-ETLRax68A,1426
371
- synapse_sdk-2025.10.3.dist-info/licenses/LICENSE,sha256=bKzmC5YAg4V1Fhl8OO_tqY8j62hgdncAkN7VrdjmrGk,1101
372
- synapse_sdk-2025.10.3.dist-info/METADATA,sha256=wvNWIgxu6dCxIudxnaO9yKxC-mg0xApM6CRul_s95m0,4186
373
- synapse_sdk-2025.10.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
374
- synapse_sdk-2025.10.3.dist-info/entry_points.txt,sha256=VNptJoGoNJI8yLXfBmhgUefMsmGI0m3-0YoMvrOgbxo,48
375
- synapse_sdk-2025.10.3.dist-info/top_level.txt,sha256=ytgJMRK1slVOKUpgcw3LEyHHP7S34J6n_gJzdkcSsw8,12
376
- synapse_sdk-2025.10.3.dist-info/RECORD,,
379
+ synapse_sdk-2025.10.4.dist-info/licenses/LICENSE,sha256=bKzmC5YAg4V1Fhl8OO_tqY8j62hgdncAkN7VrdjmrGk,1101
380
+ synapse_sdk-2025.10.4.dist-info/METADATA,sha256=PlcCqkFByX8o9NHv9QZQiCy79fkfz_kUL-jMCTCPd9I,4186
381
+ synapse_sdk-2025.10.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
382
+ synapse_sdk-2025.10.4.dist-info/entry_points.txt,sha256=VNptJoGoNJI8yLXfBmhgUefMsmGI0m3-0YoMvrOgbxo,48
383
+ synapse_sdk-2025.10.4.dist-info/top_level.txt,sha256=ytgJMRK1slVOKUpgcw3LEyHHP7S34J6n_gJzdkcSsw8,12
384
+ synapse_sdk-2025.10.4.dist-info/RECORD,,