datashare-python 0.12.3__py3-none-any.whl → 0.12.6__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.
@@ -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 Field, 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,10 +61,23 @@ class DatashareClientConfig(BaseModel):
61
61
  class TemporalClientConfig(BaseModel):
62
62
  host: str = "temporal:7233"
63
63
  namespace: str = "datashare-default"
64
- prometheus_address: str | None = Field(alias="prometheus_host", default=None)
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
 
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: datashare-python
3
- Version: 0.12.3
3
+ Version: 0.12.6
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,7 +1,7 @@
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=wKgZN_bgwcjlpZzSByjm-MPq2-Xz3Yn9pDc0mgRtM2c,4536
4
+ datashare_python/config.py,sha256=MXw9Y6H90OPBE7GqOgtSl8MJ50EAF_u6uWotiAVj2fg,5098
5
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
@@ -15,14 +15,14 @@ datashare_python/task_client.py,sha256=oTmP8bvZW0UyhLNMi1AV3XIAx7hrdbxNRss2Mw2az
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=cTtogz0J5ALPegNepBZ8yOAh7CIrPznCGvd8oi9fXlU,281043
18
+ datashare_python/worker-template.tar.gz,sha256=T90v0vDtRUNu1xpKpG9g82kUTx9rU046TIxhs2EGW48,281043
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.3.dist-info/METADATA,sha256=c7wKApN6GFBz8nol0wWJnpzHTSMOWsNLYmUWvbXSn64,1012
26
- datashare_python-0.12.3.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
27
- datashare_python-0.12.3.dist-info/entry_points.txt,sha256=ILE7auxabHWiu3GC-AunWnzjhOI_SbZp7D4GqZHlLw4,68
28
- datashare_python-0.12.3.dist-info/RECORD,,
25
+ datashare_python-0.12.6.dist-info/METADATA,sha256=24n8gTSOiSfuuqaZZa-6kttkIxvcK3gCrqyAJOP5768,1012
26
+ datashare_python-0.12.6.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
27
+ datashare_python-0.12.6.dist-info/entry_points.txt,sha256=ILE7auxabHWiu3GC-AunWnzjhOI_SbZp7D4GqZHlLw4,68
28
+ datashare_python-0.12.6.dist-info/RECORD,,