malevich-coretools 0.3.38__tar.gz → 0.3.39__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.

Potentially problematic release.


This version of malevich-coretools might be problematic. Click here for more details.

Files changed (38) hide show
  1. {malevich_coretools-0.3.38/malevich_coretools.egg-info → malevich_coretools-0.3.39}/PKG-INFO +5 -2
  2. malevich_coretools-0.3.39/VERSION +1 -0
  3. {malevich_coretools-0.3.38 → malevich_coretools-0.3.39}/malevich_coretools/abstract/abstract.py +2 -0
  4. {malevich_coretools-0.3.38 → malevich_coretools-0.3.39}/malevich_coretools/funcs/funcs.py +10 -2
  5. {malevich_coretools-0.3.38 → malevich_coretools-0.3.39}/malevich_coretools/secondary/const.py +5 -0
  6. {malevich_coretools-0.3.38 → malevich_coretools-0.3.39}/malevich_coretools/utils.py +42 -1
  7. {malevich_coretools-0.3.38 → malevich_coretools-0.3.39/malevich_coretools.egg-info}/PKG-INFO +5 -2
  8. malevich_coretools-0.3.38/VERSION +0 -1
  9. {malevich_coretools-0.3.38 → malevich_coretools-0.3.39}/LICENSE +0 -0
  10. {malevich_coretools-0.3.38 → malevich_coretools-0.3.39}/MANIFEST.in +0 -0
  11. {malevich_coretools-0.3.38 → malevich_coretools-0.3.39}/README.md +0 -0
  12. {malevich_coretools-0.3.38 → malevich_coretools-0.3.39}/malevich_coretools/__init__.py +0 -0
  13. {malevich_coretools-0.3.38 → malevich_coretools-0.3.39}/malevich_coretools/abstract/__init__.py +0 -0
  14. {malevich_coretools-0.3.38 → malevich_coretools-0.3.39}/malevich_coretools/abstract/operations.py +0 -0
  15. {malevich_coretools-0.3.38 → malevich_coretools-0.3.39}/malevich_coretools/abstract/pipeline.py +0 -0
  16. {malevich_coretools-0.3.38 → malevich_coretools-0.3.39}/malevich_coretools/abstract/statuses.py +0 -0
  17. {malevich_coretools-0.3.38 → malevich_coretools-0.3.39}/malevich_coretools/admin/__init__.py +0 -0
  18. {malevich_coretools-0.3.38 → malevich_coretools-0.3.39}/malevich_coretools/admin/utils.py +0 -0
  19. {malevich_coretools-0.3.38 → malevich_coretools-0.3.39}/malevich_coretools/batch/__init__.py +0 -0
  20. {malevich_coretools-0.3.38 → malevich_coretools-0.3.39}/malevich_coretools/batch/utils.py +0 -0
  21. {malevich_coretools-0.3.38 → malevich_coretools-0.3.39}/malevich_coretools/funcs/__init__.py +0 -0
  22. {malevich_coretools-0.3.38 → malevich_coretools-0.3.39}/malevich_coretools/funcs/checks.py +0 -0
  23. {malevich_coretools-0.3.38 → malevich_coretools-0.3.39}/malevich_coretools/funcs/helpers.py +0 -0
  24. {malevich_coretools-0.3.38 → malevich_coretools-0.3.39}/malevich_coretools/secondary/__init__.py +0 -0
  25. {malevich_coretools-0.3.38 → malevich_coretools-0.3.39}/malevich_coretools/secondary/config.py +0 -0
  26. {malevich_coretools-0.3.38 → malevich_coretools-0.3.39}/malevich_coretools/secondary/helpers.py +0 -0
  27. {malevich_coretools-0.3.38 → malevich_coretools-0.3.39}/malevich_coretools/secondary/kafka_utils.py +0 -0
  28. {malevich_coretools-0.3.38 → malevich_coretools-0.3.39}/malevich_coretools/tools/__init__.py +0 -0
  29. {malevich_coretools-0.3.38 → malevich_coretools-0.3.39}/malevich_coretools/tools/abstract.py +0 -0
  30. {malevich_coretools-0.3.38 → malevich_coretools-0.3.39}/malevich_coretools/tools/vast.py +0 -0
  31. {malevich_coretools-0.3.38 → malevich_coretools-0.3.39}/malevich_coretools.egg-info/SOURCES.txt +0 -0
  32. {malevich_coretools-0.3.38 → malevich_coretools-0.3.39}/malevich_coretools.egg-info/dependency_links.txt +0 -0
  33. {malevich_coretools-0.3.38 → malevich_coretools-0.3.39}/malevich_coretools.egg-info/requires.txt +0 -0
  34. {malevich_coretools-0.3.38 → malevich_coretools-0.3.39}/malevich_coretools.egg-info/top_level.txt +0 -0
  35. {malevich_coretools-0.3.38 → malevich_coretools-0.3.39}/pyproject.toml +0 -0
  36. {malevich_coretools-0.3.38 → malevich_coretools-0.3.39}/requirements.txt +0 -0
  37. {malevich_coretools-0.3.38 → malevich_coretools-0.3.39}/setup.cfg +0 -0
  38. {malevich_coretools-0.3.38 → malevich_coretools-0.3.39}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: malevich-coretools
3
- Version: 0.3.38
3
+ Version: 0.3.39
4
4
  Author: Andrew Pogrebnoj
5
5
  Author-email: andrew@onjulius.co
6
6
  License-File: LICENSE
@@ -9,3 +9,6 @@ Requires-Dist: pydantic
9
9
  Requires-Dist: pandas
10
10
  Requires-Dist: aiohttp
11
11
  Requires-Dist: kafka-python
12
+ Dynamic: author
13
+ Dynamic: author-email
14
+ Dynamic: requires-dist
@@ -0,0 +1 @@
1
+ 0.3.39
@@ -188,6 +188,7 @@ class MainTask(BaseModel):
188
188
  waitRuns: bool = True
189
189
  profileMode: Optional[str] = None
190
190
  withLogs: bool = False # use only in prepare
191
+ saveFails: bool = True
191
192
  scaleInfo: List[ScaleInfo]
192
193
  component: TaskComponent
193
194
  policy: TaskPolicy
@@ -216,6 +217,7 @@ class MainPipeline(BaseModel):
216
217
  kafkaModeUrl: Optional[str] = None
217
218
  run: bool = True
218
219
  synthetic: bool = False
220
+ saveFails: bool = True
219
221
 
220
222
 
221
223
  class RunTask(Operation):
@@ -142,7 +142,7 @@ def delete_collections_id_del(id: str, data: DocsCollectionChange, wait: bool, *
142
142
  # CollectionObjectsController
143
143
 
144
144
 
145
- def get_collection_objects(path: Optional[str], recursive: Optional[str], *args, **kwargs) -> FilesDirs:
145
+ def get_collection_objects(path: Optional[str], recursive: Optional[bool], *args, **kwargs) -> FilesDirs:
146
146
  return model_from_json(send_to_core_get(COLLECTION_OBJECTS_ALL_GET(path, recursive), *args, **kwargs), FilesDirs)
147
147
 
148
148
 
@@ -816,6 +816,14 @@ def post_analytics_many(data: UserAnalyticsBatch, wait: bool, *args, **kwargs) -
816
816
  return model_from_json(send_to_core_modify(ANALYTICS_MANY(wait), data, *args, **kwargs), ResultIds)
817
817
 
818
818
 
819
+ def get_runsInfo_last_operation_ids(count: int, *args, **kwargs) -> ResultIds:
820
+ return model_from_json(send_to_core_get(RUNS_INFO_LAST(count), *args, **kwargs), ResultIds)
821
+
822
+
823
+ def get_runsInfo_last_failed_operation_ids(count: int, *args, **kwargs) -> ResultIds:
824
+ return model_from_json(send_to_core_get(RUNS_INFO_LAST_FAILED(count), *args, **kwargs), ResultIds)
825
+
826
+
819
827
  async def kafka_send(data: KafkaMsg, *args, **kwargs) -> Union[Alias.Info, KafkaMsg]:
820
828
  result = await send_to_core_post_async(KAFKA_SEND, data, *args, **kwargs)
821
829
  try:
@@ -1046,7 +1054,7 @@ async def send_to_core_post_async(path: str, operation: Optional[str] = None, wi
1046
1054
  if auth is None or not with_auth:
1047
1055
  auth = (Config.CORE_USERNAME, Config.CORE_PASSWORD) if with_auth else None
1048
1056
  if auth is not None:
1049
- auth = aiohttp.BasicAuth(login=auth[0], password=auth[1], encoding='utf-8')
1057
+ auth = aiohttp.BasicAuth(login=auth[0], password=auth[1], encoding='utf-8')
1050
1058
  if operation is not None:
1051
1059
  operation = json.dumps(operation.model_dump())
1052
1060
 
@@ -205,6 +205,11 @@ ANALYTICS_MANY = lambda wait: with_wait(f"{ANALYTICS_MAIN}/many", wait)
205
205
  ANALYTICS_ID = lambda id, wait: with_wait(f"{ANALYTICS_MAIN}/{id}", wait)
206
206
  ANALYTICS_NAME = lambda name, wait: with_wait(f"{ANALYTICS_MAIN}/name/{name}", wait)
207
207
 
208
+ ## RunsInfoController
209
+ RUNS_INFO_MAIN = f"{API_VERSION}/runsInfo"
210
+ RUNS_INFO_LAST = lambda count: with_key_values(f"{RUNS_INFO_MAIN}/lastOperationsIds", {"count": count})
211
+ RUNS_INFO_LAST_FAILED = lambda count: with_key_values(f"{RUNS_INFO_MAIN}/lastFailedOperationsIds", {"count": count})
212
+
208
213
  ### Kafka
209
214
  KAFKA_SEND = f"{MANAGER_MAIN}/kafkaMsg"
210
215
 
@@ -677,7 +677,7 @@ def delete_from_collection(
677
677
 
678
678
  def get_collection_objects(
679
679
  path: Optional[str] = None,
680
- recursive: Optional[str] = None,
680
+ recursive: Optional[bool] = None,
681
681
  *,
682
682
  auth: Optional[AUTH] = None,
683
683
  conn_url: Optional[str] = None,
@@ -2650,6 +2650,7 @@ def task_full(
2650
2650
  core_manage: bool = False,
2651
2651
  single_request: bool = False,
2652
2652
  profile_mode: Optional[str] = None,
2653
+ save_fails: bool = True,
2653
2654
  with_show: bool = True,
2654
2655
  long: bool = False,
2655
2656
  long_timeout: Optional[int] = WAIT_RESULT_TIMEOUT,
@@ -2708,6 +2709,7 @@ def task_full(
2708
2709
  waitRuns=True,
2709
2710
  profileMode=profile_mode,
2710
2711
  withLogs=True,
2712
+ saveFails=save_fails,
2711
2713
  scaleInfo=scaleInfo,
2712
2714
  component=component,
2713
2715
  policy=policy,
@@ -2752,6 +2754,7 @@ def task_prepare(
2752
2754
  wait_runs: bool = True,
2753
2755
  with_logs: bool = False,
2754
2756
  profile_mode: Optional[str] = None,
2757
+ save_fails: bool = True,
2755
2758
  with_show: bool = None,
2756
2759
  long: bool = False,
2757
2760
  long_timeout: int = WAIT_RESULT_TIMEOUT,
@@ -2822,6 +2825,7 @@ def task_prepare(
2822
2825
  run=False,
2823
2826
  waitRuns=wait_runs,
2824
2827
  withLogs=with_logs,
2828
+ saveFails=save_fails,
2825
2829
  profileMode=profile_mode,
2826
2830
  scaleInfo=scaleInfo,
2827
2831
  component=component,
@@ -2943,6 +2947,7 @@ def pipeline_full(
2943
2947
  schedule: Optional[Schedule] = None,
2944
2948
  restrictions: Optional[Restrictions] = None,
2945
2949
  scaleInfo: List[ScaleInfo] = None,
2950
+ save_fails: bool = True,
2946
2951
  with_show: bool = True,
2947
2952
  long: bool = False,
2948
2953
  long_timeout: Optional[int] = WAIT_RESULT_TIMEOUT,
@@ -2984,6 +2989,7 @@ def pipeline_full(
2984
2989
  withListener=False,
2985
2990
  kafkaModeUrl=None,
2986
2991
  run=True,
2992
+ saveFails=save_fails,
2987
2993
  )
2988
2994
  if batcher is not None:
2989
2995
  return batcher.add("sendPipeline", data=data, result_model=AppLogs)
@@ -3030,6 +3036,7 @@ def pipeline_prepare(
3030
3036
  with_listener: bool = False,
3031
3037
  kafka_mode_url_response: Optional[str] = None,
3032
3038
  synthetic: bool = False,
3039
+ save_fails: bool = True,
3033
3040
  with_show: bool = True,
3034
3041
  long: bool = False,
3035
3042
  long_timeout: Optional[int] = WAIT_RESULT_TIMEOUT,
@@ -3071,6 +3078,7 @@ def pipeline_prepare(
3071
3078
  kafkaModeUrl=kafka_mode_url_response,
3072
3079
  run=False,
3073
3080
  synthetic=synthetic,
3081
+ saveFails=save_fails,
3074
3082
  )
3075
3083
  if batcher is not None:
3076
3084
  return batcher.add("sendPipeline", data=data, result_model=AppLogs)
@@ -3512,6 +3520,39 @@ def update_analytics_many(
3512
3520
  )
3513
3521
 
3514
3522
 
3523
+ # RunsInfo
3524
+
3525
+
3526
+ def get_last_runs(
3527
+ count: int = 10,
3528
+ *,
3529
+ auth: Optional[AUTH] = None,
3530
+ conn_url: Optional[str] = None,
3531
+ batcher: Optional[Batcher] = None
3532
+ ) -> ResultIds:
3533
+ """return last operationIds (prepared task/pipeline)"""
3534
+ if batcher is None:
3535
+ batcher = Config.BATCHER
3536
+ if batcher is not None:
3537
+ return batcher.add("getLastOperationsIds", vars={"count": count}, result_model=ResultIds)
3538
+ return f.get_runsInfo_last_operation_ids(count, auth=auth, conn_url=conn_url)
3539
+
3540
+
3541
+ def get_last_failed_runs(
3542
+ count: int = 5,
3543
+ *,
3544
+ auth: Optional[AUTH] = None,
3545
+ conn_url: Optional[str] = None,
3546
+ batcher: Optional[Batcher] = None
3547
+ ) -> ResultIds:
3548
+ """return last operationIds (failed prepare/run of task/pipeline)"""
3549
+ if batcher is None:
3550
+ batcher = Config.BATCHER
3551
+ if batcher is not None:
3552
+ return batcher.add("getLastFailedOperationsIds", vars={"count": count}, result_model=ResultIds)
3553
+ return f.get_runsInfo_last_failed_operation_ids(count, auth=auth, conn_url=conn_url)
3554
+
3555
+
3515
3556
  # kafka
3516
3557
 
3517
3558
 
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: malevich-coretools
3
- Version: 0.3.38
3
+ Version: 0.3.39
4
4
  Author: Andrew Pogrebnoj
5
5
  Author-email: andrew@onjulius.co
6
6
  License-File: LICENSE
@@ -9,3 +9,6 @@ Requires-Dist: pydantic
9
9
  Requires-Dist: pandas
10
10
  Requires-Dist: aiohttp
11
11
  Requires-Dist: kafka-python
12
+ Dynamic: author
13
+ Dynamic: author-email
14
+ Dynamic: requires-dist
@@ -1 +0,0 @@
1
- 0.3.38