datashare-python 0.10.7__tar.gz → 0.10.9__tar.gz
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.
- {datashare_python-0.10.7 → datashare_python-0.10.9}/PKG-INFO +1 -1
- {datashare_python-0.10.7 → datashare_python-0.10.9}/datashare_python/utils.py +22 -3
- datashare_python-0.10.9/datashare_python/worker-template.tar.gz +0 -0
- {datashare_python-0.10.7 → datashare_python-0.10.9}/pyproject.toml +1 -1
- datashare_python-0.10.7/datashare_python/worker-template.tar.gz +0 -0
- {datashare_python-0.10.7 → datashare_python-0.10.9}/.gitignore +0 -0
- {datashare_python-0.10.7 → datashare_python-0.10.9}/README.md +0 -0
- {datashare_python-0.10.7 → datashare_python-0.10.9}/datashare_python/.gitignore +0 -0
- {datashare_python-0.10.7 → datashare_python-0.10.9}/datashare_python/__init__.py +0 -0
- {datashare_python-0.10.7 → datashare_python-0.10.9}/datashare_python/__main__.py +0 -0
- {datashare_python-0.10.7 → datashare_python-0.10.9}/datashare_python/cli/__init__.py +0 -0
- {datashare_python-0.10.7 → datashare_python-0.10.9}/datashare_python/cli/project.py +0 -0
- {datashare_python-0.10.7 → datashare_python-0.10.9}/datashare_python/cli/task.py +0 -0
- {datashare_python-0.10.7 → datashare_python-0.10.9}/datashare_python/cli/utils.py +0 -0
- {datashare_python-0.10.7 → datashare_python-0.10.9}/datashare_python/cli/worker.py +0 -0
- {datashare_python-0.10.7 → datashare_python-0.10.9}/datashare_python/config.py +0 -0
- {datashare_python-0.10.7 → datashare_python-0.10.9}/datashare_python/conftest.py +0 -0
- {datashare_python-0.10.7 → datashare_python-0.10.9}/datashare_python/constants.py +0 -0
- {datashare_python-0.10.7 → datashare_python-0.10.9}/datashare_python/dependencies.py +0 -0
- {datashare_python-0.10.7 → datashare_python-0.10.9}/datashare_python/discovery.py +0 -0
- {datashare_python-0.10.7 → datashare_python-0.10.9}/datashare_python/exceptions.py +0 -0
- {datashare_python-0.10.7 → datashare_python-0.10.9}/datashare_python/interceptors.py +0 -0
- {datashare_python-0.10.7 → datashare_python-0.10.9}/datashare_python/logging_.py +0 -0
- {datashare_python-0.10.7 → datashare_python-0.10.9}/datashare_python/mimetypes_.py +0 -0
- {datashare_python-0.10.7 → datashare_python-0.10.9}/datashare_python/objects.py +0 -0
- {datashare_python-0.10.7 → datashare_python-0.10.9}/datashare_python/task_client.py +0 -0
- {datashare_python-0.10.7 → datashare_python-0.10.9}/datashare_python/template.py +0 -0
- {datashare_python-0.10.7 → datashare_python-0.10.9}/datashare_python/types_.py +0 -0
- {datashare_python-0.10.7 → datashare_python-0.10.9}/datashare_python/worker.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: datashare-python
|
|
3
|
-
Version: 0.10.
|
|
3
|
+
Version: 0.10.9
|
|
4
4
|
Summary: Manage Python tasks and local resources in Datashare
|
|
5
5
|
Project-URL: Homepage, https://icij.github.io/datashare-python/
|
|
6
6
|
Project-URL: Documentation, https://icij.github.io/datashare-python/
|
|
@@ -228,7 +228,7 @@ def _unpack_positional_args(
|
|
|
228
228
|
|
|
229
229
|
|
|
230
230
|
def with_retriables[**P, T](
|
|
231
|
-
retriables: set[type[Exception]] = None
|
|
231
|
+
logger: logging.Logger, retriables: set[type[Exception]] = None
|
|
232
232
|
) -> Callable[[Callable[P, T]], Callable[P, T]]:
|
|
233
233
|
if retriables is None:
|
|
234
234
|
|
|
@@ -240,6 +240,7 @@ def with_retriables[**P, T](
|
|
|
240
240
|
try:
|
|
241
241
|
return await activity_fn(*args, **kwargs)
|
|
242
242
|
except Exception as e:
|
|
243
|
+
logger.exception("failing activity due to non retriable error")
|
|
243
244
|
raise fatal_error_from_exception(e) from e
|
|
244
245
|
else:
|
|
245
246
|
|
|
@@ -248,6 +249,7 @@ def with_retriables[**P, T](
|
|
|
248
249
|
try:
|
|
249
250
|
return activity_fn(*args, **kwargs)
|
|
250
251
|
except Exception as e:
|
|
252
|
+
logger.exception("failing activity due to non retriable error")
|
|
251
253
|
raise fatal_error_from_exception(e) from e
|
|
252
254
|
|
|
253
255
|
return wrapper
|
|
@@ -262,8 +264,12 @@ def with_retriables[**P, T](
|
|
|
262
264
|
try:
|
|
263
265
|
return await activity_fn(*args, **kwargs)
|
|
264
266
|
except retriables:
|
|
267
|
+
logger.exception(
|
|
268
|
+
"retriable error occurred during activity, will retry !"
|
|
269
|
+
)
|
|
265
270
|
raise
|
|
266
271
|
except Exception as e:
|
|
272
|
+
logger.exception("failing activity due to non retriable error")
|
|
267
273
|
raise fatal_error_from_exception(e) from e
|
|
268
274
|
|
|
269
275
|
else:
|
|
@@ -273,8 +279,12 @@ def with_retriables[**P, T](
|
|
|
273
279
|
try:
|
|
274
280
|
return activity_fn(*args, **kwargs)
|
|
275
281
|
except retriables:
|
|
282
|
+
logger.exception(
|
|
283
|
+
"retriable error occurred during activity, will retry !"
|
|
284
|
+
)
|
|
276
285
|
raise
|
|
277
286
|
except Exception as e:
|
|
287
|
+
logger.exception("failing activity due to non retriable error")
|
|
278
288
|
raise fatal_error_from_exception(e) from e
|
|
279
289
|
|
|
280
290
|
return wrapper
|
|
@@ -283,12 +293,19 @@ def with_retriables[**P, T](
|
|
|
283
293
|
|
|
284
294
|
|
|
285
295
|
def activity_defn[**P, T](
|
|
286
|
-
name: str,
|
|
296
|
+
name: str,
|
|
297
|
+
retriables: set[type[Exception]] = None,
|
|
298
|
+
logger: logging.Logger | None = None,
|
|
287
299
|
) -> Callable[[Callable[P, T]], Callable[P, T]]:
|
|
288
300
|
|
|
301
|
+
if logger is None:
|
|
302
|
+
frame = inspect.stack()[1]
|
|
303
|
+
caller_module = inspect.getmodule(frame[0])
|
|
304
|
+
logger = logging.getLogger(caller_module.__name__)
|
|
305
|
+
|
|
289
306
|
def decorator(activity_fn: Callable[P, T]) -> Callable[P, T]:
|
|
290
307
|
activity_fn = positional_args_only(activity_fn)
|
|
291
|
-
activity_fn = with_retriables(retriables)(activity_fn)
|
|
308
|
+
activity_fn = with_retriables(logger, retriables)(activity_fn)
|
|
292
309
|
activity_fn = activity.defn(activity_fn, name=name)
|
|
293
310
|
|
|
294
311
|
is_async = inspect.iscoroutinefunction(activity_fn)
|
|
@@ -718,12 +735,14 @@ class _PydanticPayloadConverter(CompositePayloadConverter):
|
|
|
718
735
|
try:
|
|
719
736
|
return super().from_payloads(payloads, type_hints)
|
|
720
737
|
except (TypeError, ValidationError) as e:
|
|
738
|
+
logger.exception("failing activity due to non retriable error")
|
|
721
739
|
raise fatal_error_from_exception(e) from e
|
|
722
740
|
|
|
723
741
|
def to_payloads(self, values: Sequence[Any]) -> list[Payload]:
|
|
724
742
|
try:
|
|
725
743
|
return super().to_payloads(values)
|
|
726
744
|
except (TypeError, ValidationError) as e:
|
|
745
|
+
logger.exception("failing activity due to non retriable error")
|
|
727
746
|
raise fatal_error_from_exception(e) from e
|
|
728
747
|
|
|
729
748
|
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|