synapse-sdk 1.0.0a95__py3-none-any.whl → 1.0.0a96__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.

@@ -24,6 +24,20 @@ from synapse_sdk.utils.pydantic.validators import non_blank
24
24
  from synapse_sdk.utils.storage import get_pathlib
25
25
 
26
26
 
27
+ class PathAwareJSONEncoder(json.JSONEncoder):
28
+ """Custom JSON encoder that handles Path-like objects."""
29
+
30
+ def default(self, obj):
31
+ if hasattr(obj, '__fspath__') or hasattr(obj, 'as_posix'):
32
+ # Handle Path-like objects (including UPath, SFTPPath, pathlib.Path, etc.)
33
+ return str(obj)
34
+ elif hasattr(obj, 'isoformat'):
35
+ # Handle datetime objects
36
+ return obj.isoformat()
37
+ # Let the base class handle other types
38
+ return super().default(obj)
39
+
40
+
27
41
  class UploadStatus(str, Enum):
28
42
  SUCCESS = 'success'
29
43
  FAILED = 'failed'
@@ -67,7 +81,8 @@ class UploadRun(Run):
67
81
  status (UploadStatus): The status of the data file.
68
82
  """
69
83
  now = datetime.now().isoformat()
70
- data_file_info_str = json.dumps(data_file_info, ensure_ascii=False)
84
+ # Use custom JSON encoder to handle Path-like objects
85
+ data_file_info_str = json.dumps(data_file_info, ensure_ascii=False, cls=PathAwareJSONEncoder)
71
86
  self.log(
72
87
  'upload_data_file',
73
88
  self.DataFileLog(data_file_info=data_file_info_str, status=status.value, created=now).model_dump(),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: synapse-sdk
3
- Version: 1.0.0a95
3
+ Version: 1.0.0a96
4
4
  Summary: synapse sdk
5
5
  Author-email: datamaker <developer@datamaker.io>
6
6
  License: MIT
@@ -165,7 +165,7 @@ synapse_sdk/plugins/categories/smart_tool/templates/plugin/__init__.py,sha256=47
165
165
  synapse_sdk/plugins/categories/smart_tool/templates/plugin/auto_label.py,sha256=eevNg0nOcYFR4z_L_R-sCvVOYoLWSAH1jwDkAf3YCjY,320
166
166
  synapse_sdk/plugins/categories/upload/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
167
167
  synapse_sdk/plugins/categories/upload/actions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
168
- synapse_sdk/plugins/categories/upload/actions/upload.py,sha256=W2GYvzzV1ZPljUezwZiFYlihq1muIJVdinnsNW7Nyw8,37673
168
+ synapse_sdk/plugins/categories/upload/actions/upload.py,sha256=YATMn9ud8cqWKw4Pq14XhuCPvn5NTq_7RyfZv5hG75w,38279
169
169
  synapse_sdk/plugins/categories/upload/templates/config.yaml,sha256=6_dRa0_J2aS8NSUfO4MKbPxZcdPS2FpJzzp51edYAZc,281
170
170
  synapse_sdk/plugins/categories/upload/templates/plugin/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
171
171
  synapse_sdk/plugins/categories/upload/templates/plugin/upload.py,sha256=IZU4sdSMSLKPCtlNqF7DP2howTdYR6hr74HCUZsGdPk,1559
@@ -221,9 +221,9 @@ synapse_sdk/utils/storage/providers/gcp.py,sha256=i2BQCu1Kej1If9SuNr2_lEyTcr5M_n
221
221
  synapse_sdk/utils/storage/providers/http.py,sha256=2DhIulND47JOnS5ZY7MZUex7Su3peAPksGo1Wwg07L4,5828
222
222
  synapse_sdk/utils/storage/providers/s3.py,sha256=ZmqekAvIgcQBdRU-QVJYv1Rlp6VHfXwtbtjTSphua94,2573
223
223
  synapse_sdk/utils/storage/providers/sftp.py,sha256=_8s9hf0JXIO21gvm-JVS00FbLsbtvly4c-ETLRax68A,1426
224
- synapse_sdk-1.0.0a95.dist-info/licenses/LICENSE,sha256=bKzmC5YAg4V1Fhl8OO_tqY8j62hgdncAkN7VrdjmrGk,1101
225
- synapse_sdk-1.0.0a95.dist-info/METADATA,sha256=xvnJ6ZPqDHNbb1yBCb0jmh456ZLZTJjoWjhmGGXlSgk,3837
226
- synapse_sdk-1.0.0a95.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
227
- synapse_sdk-1.0.0a95.dist-info/entry_points.txt,sha256=VNptJoGoNJI8yLXfBmhgUefMsmGI0m3-0YoMvrOgbxo,48
228
- synapse_sdk-1.0.0a95.dist-info/top_level.txt,sha256=ytgJMRK1slVOKUpgcw3LEyHHP7S34J6n_gJzdkcSsw8,12
229
- synapse_sdk-1.0.0a95.dist-info/RECORD,,
224
+ synapse_sdk-1.0.0a96.dist-info/licenses/LICENSE,sha256=bKzmC5YAg4V1Fhl8OO_tqY8j62hgdncAkN7VrdjmrGk,1101
225
+ synapse_sdk-1.0.0a96.dist-info/METADATA,sha256=5UeC7skKojVvQZpdH1wkcoHm384G3GYNs0t5O-TvKe8,3837
226
+ synapse_sdk-1.0.0a96.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
227
+ synapse_sdk-1.0.0a96.dist-info/entry_points.txt,sha256=VNptJoGoNJI8yLXfBmhgUefMsmGI0m3-0YoMvrOgbxo,48
228
+ synapse_sdk-1.0.0a96.dist-info/top_level.txt,sha256=ytgJMRK1slVOKUpgcw3LEyHHP7S34J6n_gJzdkcSsw8,12
229
+ synapse_sdk-1.0.0a96.dist-info/RECORD,,