datashare-python 0.12.2__py3-none-any.whl → 0.12.5__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.
- datashare_python/config.py +19 -6
- datashare_python/conftest.py +1 -1
- datashare_python/objects.py +1 -1
- datashare_python/worker-template.tar.gz +0 -0
- {datashare_python-0.12.2.dist-info → datashare_python-0.12.5.dist-info}/METADATA +1 -1
- {datashare_python-0.12.2.dist-info → datashare_python-0.12.5.dist-info}/RECORD +8 -8
- {datashare_python-0.12.2.dist-info → datashare_python-0.12.5.dist-info}/WHEEL +0 -0
- {datashare_python-0.12.2.dist-info → datashare_python-0.12.5.dist-info}/entry_points.txt +0 -0
datashare_python/config.py
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
from datetime import timedelta
|
|
2
2
|
from enum import StrEnum
|
|
3
|
-
from typing import TYPE_CHECKING, Literal
|
|
3
|
+
from typing import TYPE_CHECKING, Any, Literal
|
|
4
4
|
|
|
5
5
|
from icij_common.es import ESClient
|
|
6
6
|
from icij_common.pydantic_utils import ICIJSettings
|
|
7
|
-
from pydantic import PrivateAttr
|
|
7
|
+
from pydantic import PrivateAttr, model_validator
|
|
8
8
|
from pydantic_settings import SettingsConfigDict
|
|
9
9
|
from temporalio.runtime import PrometheusConfig, Runtime, TelemetryConfig
|
|
10
10
|
|
|
@@ -61,18 +61,31 @@ class DatashareClientConfig(BaseModel):
|
|
|
61
61
|
class TemporalClientConfig(BaseModel):
|
|
62
62
|
host: str = "temporal:7233"
|
|
63
63
|
namespace: str = "datashare-default"
|
|
64
|
-
|
|
64
|
+
prometheus_address: str | None = None
|
|
65
65
|
|
|
66
66
|
_client: TemporalClient | None = PrivateAttr(default=None)
|
|
67
67
|
|
|
68
|
+
@model_validator(mode="before")
|
|
69
|
+
@classmethod
|
|
70
|
+
def _prometheus_host_backward_compatibility(cls, v: Any) -> Any:
|
|
71
|
+
# the combination of nested_model_default_partial_update=True in the
|
|
72
|
+
# WorkerConfig with extra="forbid" makes alias fail when loading from envvars.
|
|
73
|
+
# We can't use field aliases...
|
|
74
|
+
if not isinstance(v, dict):
|
|
75
|
+
return v
|
|
76
|
+
prometheus_address = v.pop("prometheus_host", v.pop("PROMETHEUS_HOST", None))
|
|
77
|
+
if prometheus_address is not None:
|
|
78
|
+
v["prometheus_address"] = prometheus_address
|
|
79
|
+
return v
|
|
80
|
+
|
|
68
81
|
async def to_client(self) -> TemporalClient:
|
|
69
82
|
from .utils import PYDANTIC_DATA_CONVERTER # noqa: PLC0415
|
|
70
83
|
|
|
71
84
|
if self._client is None:
|
|
72
85
|
runtime = None
|
|
73
|
-
if self.
|
|
86
|
+
if self.prometheus_address is not None:
|
|
74
87
|
telemetry_config = TelemetryConfig(
|
|
75
|
-
metrics=PrometheusConfig(bind_address=
|
|
88
|
+
metrics=PrometheusConfig(bind_address=self.prometheus_address)
|
|
76
89
|
)
|
|
77
90
|
runtime = Runtime(telemetry=telemetry_config)
|
|
78
91
|
|
|
@@ -145,5 +158,5 @@ class WorkerConfig(ICIJSettings, BaseModel):
|
|
|
145
158
|
|
|
146
159
|
|
|
147
160
|
class ActivityTimeouts(BaseModel):
|
|
148
|
-
start_to_close: timedelta
|
|
161
|
+
start_to_close: timedelta = timedelta(minutes=10)
|
|
149
162
|
heartbeat: timedelta = timedelta(minutes=1)
|
datashare_python/conftest.py
CHANGED
|
@@ -430,7 +430,7 @@ def _run_worker_process(
|
|
|
430
430
|
runtime = Runtime(telemetry=TelemetryConfig())
|
|
431
431
|
# We don't use config.to_temporal_client since we get a problem with the
|
|
432
432
|
# temporal runtime not being properly recreated, we create it explicitely
|
|
433
|
-
if temporal_config.
|
|
433
|
+
if temporal_config.prometheus_address is not None:
|
|
434
434
|
telemetry_config = TelemetryConfig(
|
|
435
435
|
metrics=PrometheusConfig(bind_address="0.0.0.0:9000")
|
|
436
436
|
)
|
datashare_python/objects.py
CHANGED
|
@@ -718,7 +718,7 @@ class ErrorReportWithPages(ProcessingReportWithPages, ABC):
|
|
|
718
718
|
return ErrorReportWithPages(
|
|
719
719
|
n_docs=other.n_docs + self.n_docs,
|
|
720
720
|
n_pages=other.n_pages + self.n_pages,
|
|
721
|
-
errors=
|
|
721
|
+
errors=other.errors + self.errors,
|
|
722
722
|
)
|
|
723
723
|
|
|
724
724
|
@classmethod
|
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: datashare-python
|
|
3
|
-
Version: 0.12.
|
|
3
|
+
Version: 0.12.5
|
|
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/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
datashare_python/.gitignore,sha256=e-SRgnvGGdsjRrqgKsTzALz6Obx8IYiOjr0yaAxT6v8,22
|
|
2
2
|
datashare_python/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
3
|
datashare_python/__main__.py,sha256=g-fvS46zl9umKmGrSpl-OG-8PSuZgjqvTCqjpsZtSps,101
|
|
4
|
-
datashare_python/config.py,sha256=
|
|
5
|
-
datashare_python/conftest.py,sha256=
|
|
4
|
+
datashare_python/config.py,sha256=MXw9Y6H90OPBE7GqOgtSl8MJ50EAF_u6uWotiAVj2fg,5098
|
|
5
|
+
datashare_python/conftest.py,sha256=fpjgOBBKzwtIArcyC4qbcyTpMtr2nf0N2p-8WKkRvgs,13827
|
|
6
6
|
datashare_python/constants.py,sha256=-Irwd2bbnFGIkLVJi_SiQ7PM2eNW3Ia_co4SE6z4j-A,352
|
|
7
7
|
datashare_python/dependencies.py,sha256=Q-BIhCwWu-GGp9omYNhENZ88cF0QJ8spfaMZX40mmNU,4386
|
|
8
8
|
datashare_python/discovery.py,sha256=3mUck2GUSKu2DSP9-MM1OdVM4FqFKqfBeSQDQZxgh2g,7177
|
|
@@ -10,19 +10,19 @@ datashare_python/exceptions.py,sha256=bVHEAXxDPKfxeeMC0hJXEsrJkgsKO2ESAhxWU96GA4
|
|
|
10
10
|
datashare_python/interceptors.py,sha256=-XC-y_MvGyHlZQ6jItfMRPAmKwQkQzzncpAGxceKlwM,16485
|
|
11
11
|
datashare_python/logging_.py,sha256=96KNXhP-JR5ybu9dld4VLtF7v7PfiphOCR1Nio-mmUs,4483
|
|
12
12
|
datashare_python/mimetypes_.py,sha256=omd2g8JyN-tfZL-lmxbWsjgc987iUe5w87ZpEtbyUK0,49930
|
|
13
|
-
datashare_python/objects.py,sha256=
|
|
13
|
+
datashare_python/objects.py,sha256=oFAbqrAMHDWITOp9uNJkTOV7l0XXzfWCn964unb_DU4,26878
|
|
14
14
|
datashare_python/task_client.py,sha256=oTmP8bvZW0UyhLNMi1AV3XIAx7hrdbxNRss2Mw2azEc,8435
|
|
15
15
|
datashare_python/template.py,sha256=N1uM8TRXh5tQPV7BC1oJj-Pdm2Gs_SkjaXv50RnNYso,4682
|
|
16
16
|
datashare_python/types_.py,sha256=cPcCkIk6ecILrKetPnAsrb0njHYuWJU3eZicUXy2lF8,1278
|
|
17
17
|
datashare_python/utils.py,sha256=Y0rNipGGW4yhOK6GrhXP9cdmHWMis2oFUxRsNK9eBMU,33254
|
|
18
|
-
datashare_python/worker-template.tar.gz,sha256=
|
|
18
|
+
datashare_python/worker-template.tar.gz,sha256=0zaBIGRlxWW9pZPnaA8_XFZhIAGfk58uCEE_67BWq5U,281032
|
|
19
19
|
datashare_python/worker.py,sha256=ad36_yJOgwtj8KBheWndGkqaP_2aXTPSrYaHrbCXTvg,8389
|
|
20
20
|
datashare_python/cli/__init__.py,sha256=9BPWtssDgsVfWMsZ1TtZCla0EC_kai4RHttr8oNLYOE,1401
|
|
21
21
|
datashare_python/cli/project.py,sha256=w32Gy9AOL5B00uDT4in7YUCt2g68FnNbvwg2M3a8G6o,946
|
|
22
22
|
datashare_python/cli/task.py,sha256=GsyR5o0fN4Pd8tJKAUgivAvCBKT3L4Ay5j_BCW1XBHk,5828
|
|
23
23
|
datashare_python/cli/utils.py,sha256=p69CQb0zfixuyBkiZprhdMCc_NuYwXyAn6vC9H1UzAw,911
|
|
24
24
|
datashare_python/cli/worker.py,sha256=x0p3a1_NsZPbmV7-WSVMRyW3_iadYcgyZKbDvWgymQc,5790
|
|
25
|
-
datashare_python-0.12.
|
|
26
|
-
datashare_python-0.12.
|
|
27
|
-
datashare_python-0.12.
|
|
28
|
-
datashare_python-0.12.
|
|
25
|
+
datashare_python-0.12.5.dist-info/METADATA,sha256=VOiUCXh8AJ3yxhgj52fioQpB6iMtmRVURTcAHvU0JJk,1012
|
|
26
|
+
datashare_python-0.12.5.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
|
|
27
|
+
datashare_python-0.12.5.dist-info/entry_points.txt,sha256=ILE7auxabHWiu3GC-AunWnzjhOI_SbZp7D4GqZHlLw4,68
|
|
28
|
+
datashare_python-0.12.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|