esd-services-api-client 2.1.3__py3-none-any.whl → 2.2.1__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.
Files changed (24) hide show
  1. esd_services_api_client/_version.py +1 -1
  2. esd_services_api_client/nexus/README.md +62 -37
  3. esd_services_api_client/nexus/abstractions/algrorithm_cache.py +100 -0
  4. esd_services_api_client/nexus/abstractions/input_object.py +63 -0
  5. esd_services_api_client/nexus/abstractions/nexus_object.py +18 -10
  6. esd_services_api_client/nexus/algorithms/_baseline_algorithm.py +14 -6
  7. esd_services_api_client/nexus/algorithms/_remote_algorithm.py +118 -0
  8. esd_services_api_client/nexus/algorithms/forked_algorithm.py +124 -0
  9. esd_services_api_client/nexus/algorithms/minimalistic.py +8 -1
  10. esd_services_api_client/nexus/algorithms/recursive.py +5 -1
  11. esd_services_api_client/nexus/core/app_core.py +9 -0
  12. esd_services_api_client/nexus/core/app_dependencies.py +19 -0
  13. esd_services_api_client/nexus/exceptions/cache_errors.py +49 -0
  14. esd_services_api_client/nexus/exceptions/startup_error.py +15 -0
  15. esd_services_api_client/nexus/input/__init__.py +0 -1
  16. esd_services_api_client/nexus/input/input_processor.py +11 -58
  17. esd_services_api_client/nexus/input/input_reader.py +9 -5
  18. esd_services_api_client/nexus/telemetry/__init__.py +0 -0
  19. esd_services_api_client/nexus/telemetry/recorder.py +97 -0
  20. {esd_services_api_client-2.1.3.dist-info → esd_services_api_client-2.2.1.dist-info}/METADATA +1 -1
  21. {esd_services_api_client-2.1.3.dist-info → esd_services_api_client-2.2.1.dist-info}/RECORD +23 -17
  22. esd_services_api_client/nexus/input/_functions.py +0 -89
  23. {esd_services_api_client-2.1.3.dist-info → esd_services_api_client-2.2.1.dist-info}/LICENSE +0 -0
  24. {esd_services_api_client-2.1.3.dist-info → esd_services_api_client-2.2.1.dist-info}/WHEEL +0 -0
@@ -1,5 +1,5 @@
1
1
  esd_services_api_client/__init__.py,sha256=L-cEW1mVbnTJLCLG5V6Ucw7zBgx1zf0t1bYcQC1heyw,603
2
- esd_services_api_client/_version.py,sha256=hgD1miBO_f3fboq1GKyV4DdK_igCLGJFnZRD7l9oNRs,22
2
+ esd_services_api_client/_version.py,sha256=-7agX4LcQ0956RU4mY0EYyxYQU9llH7JklZOsqoujdU,22
3
3
  esd_services_api_client/beast/__init__.py,sha256=zNhXcHSP5w4P9quM1XP4oXVJEccvC_VScG41TZ0GzZ8,723
4
4
  esd_services_api_client/beast/v3/__init__.py,sha256=FtumtInoDyCCRE424Llqv8QZLRuwXzj-smyfu1od1nc,754
5
5
  esd_services_api_client/beast/v3/_connector.py,sha256=WNmCiTXFRb3q56mrr7ZbqBHWDUxbfyWhiWlBFLUIOnc,11478
@@ -15,32 +15,38 @@ esd_services_api_client/crystal/__init__.py,sha256=oeyJjdQ9EpTnIq6XnjPq5v0DWPdHq
15
15
  esd_services_api_client/crystal/_api_versions.py,sha256=GHbmV_5lP9fP72TZE0j_ZeQSeJjMRcRaBRxNJbz-MWQ,837
16
16
  esd_services_api_client/crystal/_connector.py,sha256=wT8SahCkkRWPoHcUSLz0I-sjeK_9OSYtt07zJKie0CU,12875
17
17
  esd_services_api_client/crystal/_models.py,sha256=OCaidMqipl-TA8VLs7v12BppyBR3QpRA5jU2KjZxU_Q,4030
18
- esd_services_api_client/nexus/README.md,sha256=Q3laWkuCxqVBFsfP58mGAys-jVZeesroIRRMiaQMntc,8688
18
+ esd_services_api_client/nexus/README.md,sha256=QQgvkhRwZtktxlzTmHkbp8KNnUvDvFGEVqvSM1QgpU8,9393
19
19
  esd_services_api_client/nexus/__init__.py,sha256=sOgKKq3_LZGbLmQMtMS7lDw2hv027qownTmNIRV0BB8,627
20
20
  esd_services_api_client/nexus/abstractions/__init__.py,sha256=sOgKKq3_LZGbLmQMtMS7lDw2hv027qownTmNIRV0BB8,627
21
+ esd_services_api_client/nexus/abstractions/algrorithm_cache.py,sha256=3Umb9bKsl8Yo5a3FMrdO_7JTk2mrYJf9MLR-_C0yzFo,3338
22
+ esd_services_api_client/nexus/abstractions/input_object.py,sha256=RUKnhekuZwd_RVvnLGAxHa4wYDFJf6wEwWQI9f-o0lM,1761
21
23
  esd_services_api_client/nexus/abstractions/logger_factory.py,sha256=9biONvCqNrP__yrmeRkoDL05TMA5v-LyrcKwgiKG59U,2019
22
- esd_services_api_client/nexus/abstractions/nexus_object.py,sha256=Be90h8iVDp2o1recnx8-Ousm3OjaVjIjthPqE5u5vik,2828
24
+ esd_services_api_client/nexus/abstractions/nexus_object.py,sha256=TFRsiqfrIRGdoZsUDrMIWSHL9LsNdrcCXO-dEliRaAA,3039
23
25
  esd_services_api_client/nexus/abstractions/socket_provider.py,sha256=Rwa_aPErI4Es5AdyCd3EoGze7mg2D70u8kuc2UGEBaI,1729
24
26
  esd_services_api_client/nexus/algorithms/__init__.py,sha256=yMvLFSqg5eUKOXI0zMFX69Ni0ibKQHOqAnrZsxQqhOo,903
25
- esd_services_api_client/nexus/algorithms/_baseline_algorithm.py,sha256=UxqGFzpl-8w4SLJX0GMxLzRinRnFVoBT2zBKzHOapBM,2694
27
+ esd_services_api_client/nexus/algorithms/_baseline_algorithm.py,sha256=24ALLx4Bxlgi0EwZB1a0SJeEwBUWKj7CGad-CpIygU0,2925
28
+ esd_services_api_client/nexus/algorithms/_remote_algorithm.py,sha256=nQDQ2si-_-B2QdtBC8IwSM8YyNwfIhrCMto6g87BcnQ,3900
26
29
  esd_services_api_client/nexus/algorithms/distributed.py,sha256=vkKSCsd480RKwrtu3uZ2iU1bh593fkgBcOBrcb9cLjA,1702
27
- esd_services_api_client/nexus/algorithms/minimalistic.py,sha256=PjLs_xhpd3rTViaLbWUEvJ1LWDPTKEZFj57iPk8wswo,1462
28
- esd_services_api_client/nexus/algorithms/recursive.py,sha256=MAyfj3gQZ0zQB5hU3RHIOfH889v_Wtp4GHBhB-trr2w,1862
30
+ esd_services_api_client/nexus/algorithms/forked_algorithm.py,sha256=Y1BFCbEMmLFmQlvq0Ot_8RAlvSbFqvZFWa_RLIYvb2Y,4310
31
+ esd_services_api_client/nexus/algorithms/minimalistic.py,sha256=tSYXodIW-_Aje-_ZyYUoWAThcZIeE4_kMvMINsT4Lb8,1644
32
+ esd_services_api_client/nexus/algorithms/recursive.py,sha256=uaCCl4q-st_KqbcmkdOJedJ0nAjbJvn6jdZEdW0_0ss,2007
29
33
  esd_services_api_client/nexus/configurations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
30
34
  esd_services_api_client/nexus/configurations/algorithm_configuration.py,sha256=eE7diX2PATCGkmqhvFOcZwXrr6vns4fqnJGmgNvhhZM,1091
31
35
  esd_services_api_client/nexus/core/__init__.py,sha256=sOgKKq3_LZGbLmQMtMS7lDw2hv027qownTmNIRV0BB8,627
32
- esd_services_api_client/nexus/core/app_core.py,sha256=gs1oIwc9KEog46vOZp6g_JVzTa8LLfcCpuauTLGhYVM,9654
33
- esd_services_api_client/nexus/core/app_dependencies.py,sha256=Ara_Yz0cwPWwZySXRRJM0I8T3-QQ52Fb1sUj_lisboE,6184
36
+ esd_services_api_client/nexus/core/app_core.py,sha256=jW6eISWBboaDe94Sy9r4w-K2-TcL9uFGJv5JOym6Brg,10037
37
+ esd_services_api_client/nexus/core/app_dependencies.py,sha256=6jrFR5x7lLSDL1rc6YlSxMpwe641rb1YAvDE455zRbQ,6674
34
38
  esd_services_api_client/nexus/exceptions/__init__.py,sha256=feN33VdqB5-2bD9aJesJl_OlsKrNNo3hZCnQgKuaU9k,696
35
39
  esd_services_api_client/nexus/exceptions/_nexus_error.py,sha256=QvtY38mNoIA6t26dUN6UIsaPfljhtVNsbQVS7ksMb-Q,895
40
+ esd_services_api_client/nexus/exceptions/cache_errors.py,sha256=IO_rBQKXfIRHHXQuC8kAHejgZZw9yvSJk5BPYBnDYbc,1622
36
41
  esd_services_api_client/nexus/exceptions/input_reader_error.py,sha256=Chy8XW6Ien4-bkZZ1CmP8CWU49mi2hobS6L_R59ONs8,1765
37
- esd_services_api_client/nexus/exceptions/startup_error.py,sha256=HPTlrg2voRbGXZsakWcVT7lcGSaccSR-GsBIo08SJ4A,1556
38
- esd_services_api_client/nexus/input/__init__.py,sha256=ahJ7yUuRTCNIYB5GitBRGAPZZX82ghISzF6lm_CkyEA,819
39
- esd_services_api_client/nexus/input/_functions.py,sha256=9bySbwcXGV7JIsQbSqg3YuW7avJUErsvsS2ZDHRWfT0,2918
40
- esd_services_api_client/nexus/input/input_processor.py,sha256=ZUdpz2M6PfsF-99-DpCMDtD9Id0SQYhC-HbjosMz8O8,4609
41
- esd_services_api_client/nexus/input/input_reader.py,sha256=MtZNdxjWLjoSqlSlwa6f7BIqsu-_GoQav5tCz2g6WrA,3214
42
+ esd_services_api_client/nexus/exceptions/startup_error.py,sha256=4Hughi57Ndi_a8YPkjPSxXWWsAZUA57Rwd-rPqwD8B8,1991
43
+ esd_services_api_client/nexus/input/__init__.py,sha256=ODYhZ791tPC4-eVxSRRlh8FLDDICU7nByLH7c4TD4Xc,758
44
+ esd_services_api_client/nexus/input/input_processor.py,sha256=vqzeQrtRFqBKTPSEiWX_JZJTF9itMwwvWjPnJVLrSwQ,3132
45
+ esd_services_api_client/nexus/input/input_reader.py,sha256=aXNMGxrdUX5RDYR666GSGkcZqYMFYoZ8zGVDuUFFFZQ,3505
42
46
  esd_services_api_client/nexus/input/payload_reader.py,sha256=Kq0xN1Shyqv71v6YkcrqVTDbmsEjZc8ithsXYpyu87M,2516
43
- esd_services_api_client-2.1.3.dist-info/LICENSE,sha256=0gS6zXsPp8qZhzi1xaGCIYPzb_0e8on7HCeFJe8fOpw,10693
44
- esd_services_api_client-2.1.3.dist-info/METADATA,sha256=2KwJkB0jRJkpN64u_2DEXITFNc5SN46eia_UVZfoREI,1292
45
- esd_services_api_client-2.1.3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
46
- esd_services_api_client-2.1.3.dist-info/RECORD,,
47
+ esd_services_api_client/nexus/telemetry/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
48
+ esd_services_api_client/nexus/telemetry/recorder.py,sha256=7LB4q7OMOFJs3bRmRiUly17v-O37f8EEFEKGzrWbSnE,3220
49
+ esd_services_api_client-2.2.1.dist-info/LICENSE,sha256=0gS6zXsPp8qZhzi1xaGCIYPzb_0e8on7HCeFJe8fOpw,10693
50
+ esd_services_api_client-2.2.1.dist-info/METADATA,sha256=Ur5XGLCupk8fWvMwcONs6dBnZLu3dht-0sAJmNCBYhM,1292
51
+ esd_services_api_client-2.2.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
52
+ esd_services_api_client-2.2.1.dist-info/RECORD,,
@@ -1,89 +0,0 @@
1
- """
2
- Utility functions to handle input processing.
3
- """
4
-
5
- # Copyright (c) 2023-2024. ECCO Sneaks & Data
6
- #
7
- # Licensed under the Apache License, Version 2.0 (the "License");
8
- # you may not use this file except in compliance with the License.
9
- # You may obtain a copy of the License at
10
- #
11
- # http://www.apache.org/licenses/LICENSE-2.0
12
- #
13
- # Unless required by applicable law or agreed to in writing, software
14
- # distributed under the License is distributed on an "AS IS" BASIS,
15
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- # See the License for the specific language governing permissions and
17
- # limitations under the License.
18
- #
19
-
20
- import asyncio
21
- from typing import Union, Type
22
- import azure.core.exceptions
23
- import deltalake
24
-
25
- from esd_services_api_client.nexus.abstractions.nexus_object import TResult, TPayload
26
- from esd_services_api_client.nexus.exceptions.input_reader_error import (
27
- FatalInputReaderError,
28
- TransientInputReaderError,
29
- )
30
- from esd_services_api_client.nexus.input.input_reader import InputReader
31
-
32
-
33
- _reader_cache = {}
34
-
35
-
36
- def resolve_reader_exc_type(
37
- ex: BaseException,
38
- ) -> Union[Type[FatalInputReaderError], Type[TransientInputReaderError]]:
39
- """
40
- Resolve base exception into a specific Nexus exception.
41
- """
42
- match type(ex):
43
- case azure.core.exceptions.HttpResponseError, deltalake.PyDeltaTableError:
44
- return TransientInputReaderError
45
- case azure.core.exceptions.AzureError, azure.core.exceptions.ClientAuthenticationError:
46
- return FatalInputReaderError
47
- case _:
48
- return FatalInputReaderError
49
-
50
-
51
- async def resolve_readers(
52
- *readers: InputReader[TPayload, TResult]
53
- ) -> dict[str, TResult]:
54
- """
55
- Concurrently resolve `data` property of all readers by invoking their `read` method.
56
- """
57
-
58
- def get_result(alias: str, completed_task: asyncio.Task) -> TResult:
59
- reader_exc = completed_task.exception()
60
- if reader_exc:
61
- raise resolve_reader_exc_type(reader_exc)(alias, reader_exc) from reader_exc
62
-
63
- return completed_task.result()
64
-
65
- async def _read(input_reader: InputReader):
66
- async with input_reader as instance:
67
- result = await instance.read()
68
- _reader_cache[input_reader.__class__.alias()] = result
69
- return result
70
-
71
- cached = {
72
- reader.__class__.alias(): reader.data
73
- for reader in readers
74
- if reader.__class__.alias() in _reader_cache
75
- }
76
- if len(cached) == len(readers):
77
- return cached
78
-
79
- read_tasks: dict[str, asyncio.Task] = {
80
- reader.__class__.alias(): asyncio.create_task(_read(reader))
81
- for reader in readers
82
- if reader.__class__.alias() not in _reader_cache
83
- }
84
- if len(read_tasks) > 0:
85
- await asyncio.wait(fs=read_tasks.values())
86
-
87
- return {
88
- alias: get_result(alias, task) for alias, task in read_tasks.items()
89
- } | cached