digitalhub 0.13.0b3__py3-none-any.whl → 0.13.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.

Potentially problematic release.


This version of digitalhub might be problematic. Click here for more details.

@@ -28,11 +28,13 @@ if typing.TYPE_CHECKING:
28
28
 
29
29
  class ContextEntityOperationsProcessor:
30
30
  """
31
- Processor for Entity operations.
31
+ Processor for context entity operations.
32
32
 
33
- This object interacts with the context, check the category of the object,
34
- and then calls the appropriate method to perform the requested operation.
35
- Operations can be CRUD, search, list, etc.
33
+ This class handles CRUD operations and other entity management tasks
34
+ for context-level entities (artifacts, functions, workflows, runs, etc.)
35
+ within projects. It manages the full lifecycle of versioned and
36
+ unversioned entities including creation, reading, updating, deletion,
37
+ import/export, and specialized operations like file uploads and metrics.
36
38
  """
37
39
 
38
40
  ##############################
@@ -46,23 +48,24 @@ class ContextEntityOperationsProcessor:
46
48
  entity_dict: dict,
47
49
  ) -> dict:
48
50
  """
49
- Create object in backend.
51
+ Create a context entity in the backend.
52
+
53
+ Builds the appropriate API endpoint and sends a create request
54
+ to the backend for context-level entities within a project.
50
55
 
51
56
  Parameters
52
57
  ----------
53
58
  context : Context
54
- Context instance.
55
- project : str
56
- Project name.
59
+ The project context instance.
57
60
  entity_type : str
58
- Entity type.
61
+ The type of entity to create (e.g., 'artifact', 'function').
59
62
  entity_dict : dict
60
- Object instance.
63
+ The entity data dictionary to create.
61
64
 
62
65
  Returns
63
66
  -------
64
67
  dict
65
- Object instance.
68
+ The created entity data returned from the backend.
66
69
  """
67
70
  api = context.client.build_api(
68
71
  ApiCategories.CONTEXT.value,
@@ -78,17 +81,25 @@ class ContextEntityOperationsProcessor:
78
81
  **kwargs,
79
82
  ) -> ContextEntity:
80
83
  """
81
- Create object in backend.
84
+ Create a context entity in the backend.
85
+
86
+ Creates a new context entity either from an existing entity object
87
+ or by building one from the provided parameters. Handles entity
88
+ creation within a project context.
82
89
 
83
90
  Parameters
84
91
  ----------
92
+ _entity : ContextEntity, optional
93
+ An existing context entity object to create. If None,
94
+ a new entity will be built from kwargs.
85
95
  **kwargs : dict
86
- Parameters to pass to entity builder.
96
+ Parameters for entity creation, including 'project' and
97
+ entity-specific parameters.
87
98
 
88
99
  Returns
89
100
  -------
90
101
  ContextEntity
91
- Object instance.
102
+ The created context entity with backend data populated.
92
103
  """
93
104
  if _entity is not None:
94
105
  context = _entity._context()
@@ -104,17 +115,29 @@ class ContextEntityOperationsProcessor:
104
115
  **kwargs,
105
116
  ) -> MaterialEntity:
106
117
  """
107
- Create object in backend and upload file.
118
+ Create a material entity in the backend and upload associated files.
119
+
120
+ Creates a new material entity (artifact, dataitem, or model) and
121
+ handles file upload operations. Manages upload state transitions
122
+ and error handling during the upload process.
108
123
 
109
124
  Parameters
110
125
  ----------
111
126
  **kwargs : dict
112
- Parameters to pass to entity builder.
127
+ Parameters for entity creation including:
128
+ - 'source': file source(s) to upload
129
+ - 'project': project name
130
+ - other entity-specific parameters
113
131
 
114
132
  Returns
115
133
  -------
116
134
  MaterialEntity
117
- Object instance.
135
+ The created material entity with uploaded files.
136
+
137
+ Raises
138
+ ------
139
+ EntityError
140
+ If file upload fails during the process.
118
141
  """
119
142
  source: SourcesOrListOfSources = kwargs.pop("source")
120
143
  context = get_context_from_project(kwargs["project"])
@@ -160,27 +183,31 @@ class ContextEntityOperationsProcessor:
160
183
  **kwargs,
161
184
  ) -> dict:
162
185
  """
163
- Read object from backend.
186
+ Read a context entity from the backend.
187
+
188
+ Retrieves entity data from the backend using either entity ID
189
+ for direct access or entity name for latest version lookup.
190
+ Handles both specific version reads and latest version queries.
164
191
 
165
192
  Parameters
166
193
  ----------
167
194
  context : Context
168
- Context instance.
195
+ The project context instance.
169
196
  identifier : str
170
- Entity key (store://...) or entity name.
171
- entity_type : str
172
- Entity type.
173
- project : str
174
- Project name.
175
- entity_id : str
176
- Entity ID.
197
+ Entity key (store://...) or entity name identifier.
198
+ entity_type : str, optional
199
+ The type of entity to read.
200
+ project : str, optional
201
+ Project name (used for identifier parsing).
202
+ entity_id : str, optional
203
+ Specific entity ID to read.
177
204
  **kwargs : dict
178
- Parameters to pass to the API call.
205
+ Additional parameters to pass to the API call.
179
206
 
180
207
  Returns
181
208
  -------
182
209
  dict
183
- Object instance.
210
+ The entity data retrieved from the backend.
184
211
  """
185
212
  project, entity_type, _, entity_name, entity_id = parse_identifier(
186
213
  identifier,
@@ -224,25 +251,28 @@ class ContextEntityOperationsProcessor:
224
251
  **kwargs,
225
252
  ) -> ContextEntity:
226
253
  """
227
- Read object from backend.
254
+ Read a context entity from the backend.
255
+
256
+ Retrieves entity data from the backend and constructs a context
257
+ entity object. Handles post-processing for metrics and file info.
228
258
 
229
259
  Parameters
230
260
  ----------
231
261
  identifier : str
232
- Entity key (store://...) or entity name.
233
- entity_type : str
234
- Entity type.
235
- project : str
236
- Project name.
237
- entity_id : str
238
- Entity ID.
262
+ Entity key (store://...) or entity name identifier.
263
+ entity_type : str, optional
264
+ The type of entity to read.
265
+ project : str, optional
266
+ Project name for context resolution.
267
+ entity_id : str, optional
268
+ Specific entity ID to read.
239
269
  **kwargs : dict
240
- Parameters to pass to the API call.
270
+ Additional parameters to pass to the API call.
241
271
 
242
272
  Returns
243
273
  -------
244
- VersionedEntity
245
- Object instance.
274
+ ContextEntity
275
+ The context entity object populated with backend data.
246
276
  """
247
277
  context = get_context_from_identifier(identifier, project)
248
278
  obj = self._read_context_entity(
@@ -265,25 +295,29 @@ class ContextEntityOperationsProcessor:
265
295
  **kwargs,
266
296
  ) -> UnversionedEntity:
267
297
  """
268
- Read object from backend.
298
+ Read an unversioned entity from the backend.
299
+
300
+ Retrieves unversioned entity data (runs, tasks) from the backend.
301
+ Handles identifier parsing for entities that don't follow the
302
+ standard versioned naming convention.
269
303
 
270
304
  Parameters
271
305
  ----------
272
306
  identifier : str
273
- Entity key (store://...) or entity name.
274
- entity_type : str
275
- Entity type.
276
- project : str
277
- Project name.
278
- entity_id : str
279
- Entity ID.
307
+ Entity key (store://...) or entity ID.
308
+ entity_type : str, optional
309
+ The type of entity to read.
310
+ project : str, optional
311
+ Project name for context resolution.
312
+ entity_id : str, optional
313
+ Specific entity ID to read.
280
314
  **kwargs : dict
281
- Parameters to pass to the API call.
315
+ Additional parameters to pass to the API call.
282
316
 
283
317
  Returns
284
318
  -------
285
319
  UnversionedEntity
286
- Object instance.
320
+ The unversioned entity object populated with backend data.
287
321
  """
288
322
  if not identifier.startswith("store://"):
289
323
  entity_id = identifier
@@ -304,17 +338,26 @@ class ContextEntityOperationsProcessor:
304
338
  file: str,
305
339
  ) -> ContextEntity:
306
340
  """
307
- Import object from a YAML file and create a new object into the backend.
341
+ Import a context entity from a YAML file and create it in the backend.
342
+
343
+ Reads entity configuration from a YAML file and creates a new
344
+ context entity in the backend. Raises an error if the entity
345
+ already exists.
308
346
 
309
347
  Parameters
310
348
  ----------
311
349
  file : str
312
- Path to YAML file.
350
+ Path to the YAML file containing entity configuration.
313
351
 
314
352
  Returns
315
353
  -------
316
354
  ContextEntity
317
- Object instance.
355
+ The imported and created context entity.
356
+
357
+ Raises
358
+ ------
359
+ EntityError
360
+ If the entity already exists in the backend.
318
361
  """
319
362
  dict_obj: dict = read_yaml(file)
320
363
  dict_obj["status"] = {}
@@ -331,17 +374,27 @@ class ContextEntityOperationsProcessor:
331
374
  file: str,
332
375
  ) -> ExecutableEntity:
333
376
  """
334
- Import object from a YAML file and create a new object into the backend.
377
+ Import an executable entity from a YAML file and create it in the backend.
378
+
379
+ Reads executable entity configuration from a YAML file and creates
380
+ a new executable entity (function or workflow) in the backend.
381
+ Also imports associated task definitions if present in the file.
335
382
 
336
383
  Parameters
337
384
  ----------
338
385
  file : str
339
- Path to YAML file.
386
+ Path to the YAML file containing executable entity configuration.
387
+ Can contain a single entity or a list with the executable and tasks.
340
388
 
341
389
  Returns
342
390
  -------
343
391
  ExecutableEntity
344
- Object instance.
392
+ The imported and created executable entity.
393
+
394
+ Raises
395
+ ------
396
+ EntityError
397
+ If the entity already exists in the backend.
345
398
  """
346
399
  dict_obj: dict | list[dict] = read_yaml(file)
347
400
  if isinstance(dict_obj, list):
@@ -371,17 +424,21 @@ class ContextEntityOperationsProcessor:
371
424
  file: str,
372
425
  ) -> ContextEntity:
373
426
  """
374
- Load object from a YAML file and update an existing object into the backend.
427
+ Load a context entity from a YAML file and update it in the backend.
428
+
429
+ Reads entity configuration from a YAML file and updates an existing
430
+ entity in the backend. If the entity doesn't exist, it creates a
431
+ new one.
375
432
 
376
433
  Parameters
377
434
  ----------
378
435
  file : str
379
- Path to YAML file.
436
+ Path to the YAML file containing entity configuration.
380
437
 
381
438
  Returns
382
439
  -------
383
440
  ContextEntity
384
- Object instance.
441
+ The loaded and updated context entity.
385
442
  """
386
443
  dict_obj: dict = read_yaml(file)
387
444
  context = get_context_from_project(dict_obj["project"])
@@ -397,17 +454,22 @@ class ContextEntityOperationsProcessor:
397
454
  file: str,
398
455
  ) -> ExecutableEntity:
399
456
  """
400
- Load object from a YAML file and update an existing object into the backend.
457
+ Load an executable entity from a YAML file and update it in the backend.
458
+
459
+ Reads executable entity configuration from a YAML file and updates
460
+ an existing executable entity in the backend. If the entity doesn't
461
+ exist, it creates a new one. Also handles task imports.
401
462
 
402
463
  Parameters
403
464
  ----------
404
465
  file : str
405
- Path to YAML file.
466
+ Path to the YAML file containing executable entity configuration.
467
+ Can contain a single entity or a list with the executable and tasks.
406
468
 
407
469
  Returns
408
470
  -------
409
471
  ExecutableEntity
410
- Object instance.
472
+ The loaded and updated executable entity.
411
473
  """
412
474
  dict_obj: dict | list[dict] = read_yaml(file)
413
475
  if isinstance(dict_obj, list):
@@ -436,25 +498,28 @@ class ContextEntityOperationsProcessor:
436
498
  **kwargs,
437
499
  ) -> list[dict]:
438
500
  """
439
- Get all versions object from backend.
501
+ Read all versions of a context entity from the backend.
502
+
503
+ Retrieves all available versions of a named entity from the
504
+ backend using the entity name identifier.
440
505
 
441
506
  Parameters
442
507
  ----------
443
508
  context : Context
444
- Context instance.
509
+ The project context instance.
445
510
  identifier : str
446
- Entity key (store://...) or entity name.
447
- entity_type : str
448
- Entity type.
449
- project : str
450
- Project name.
511
+ Entity key (store://...) or entity name identifier.
512
+ entity_type : str, optional
513
+ The type of entity to read versions for.
514
+ project : str, optional
515
+ Project name (used for identifier parsing).
451
516
  **kwargs : dict
452
- Parameters to pass to the API call.
517
+ Additional parameters to pass to the API call.
453
518
 
454
519
  Returns
455
520
  -------
456
521
  list[dict]
457
- Object instances.
522
+ List of entity data dictionaries for all versions.
458
523
  """
459
524
  project, entity_type, _, entity_name, _ = parse_identifier(
460
525
  identifier,
@@ -485,23 +550,27 @@ class ContextEntityOperationsProcessor:
485
550
  **kwargs,
486
551
  ) -> list[ContextEntity]:
487
552
  """
488
- Read object versions from backend.
553
+ Read all versions of a context entity from the backend.
554
+
555
+ Retrieves all available versions of a named entity and constructs
556
+ context entity objects for each version. Applies post-processing
557
+ for metrics and file info.
489
558
 
490
559
  Parameters
491
560
  ----------
492
561
  identifier : str
493
- Entity key (store://...) or entity name.
494
- entity_type : str
495
- Entity type.
496
- project : str
497
- Project name.
562
+ Entity key (store://...) or entity name identifier.
563
+ entity_type : str, optional
564
+ The type of entity to read versions for.
565
+ project : str, optional
566
+ Project name for context resolution.
498
567
  **kwargs : dict
499
- Parameters to pass to the API call.
568
+ Additional parameters to pass to the API call.
500
569
 
501
570
  Returns
502
571
  -------
503
572
  list[ContextEntity]
504
- List of object instances.
573
+ List of context entity objects for all versions.
505
574
  """
506
575
  context = get_context_from_identifier(identifier, project)
507
576
  objs = self._read_context_entity_versions(
@@ -525,21 +594,25 @@ class ContextEntityOperationsProcessor:
525
594
  **kwargs,
526
595
  ) -> list[dict]:
527
596
  """
528
- List objects from backend.
597
+ List context entities from the backend.
598
+
599
+ Retrieves a list of entities of a specific type from the backend
600
+ within the project context.
529
601
 
530
602
  Parameters
531
603
  ----------
532
604
  context : Context
533
- Context instance.
605
+ The project context instance.
534
606
  entity_type : str
535
- Entity type.
607
+ The type of entities to list.
536
608
  **kwargs : dict
537
- Parameters to pass to the API call.
609
+ Additional parameters to pass to the API call for filtering
610
+ or pagination.
538
611
 
539
612
  Returns
540
613
  -------
541
614
  list[dict]
542
- List of objects.
615
+ List of entity data dictionaries from the backend.
543
616
  """
544
617
  api = context.client.build_api(
545
618
  ApiCategories.CONTEXT.value,
@@ -556,21 +629,27 @@ class ContextEntityOperationsProcessor:
556
629
  **kwargs,
557
630
  ) -> list[ContextEntity]:
558
631
  """
559
- List all latest version objects from backend.
632
+ List all latest version context entities from the backend.
633
+
634
+ Retrieves a list of entities of a specific type from the backend
635
+ and constructs context entity objects. Only returns the latest
636
+ version of each entity. Applies post-processing for metrics and
637
+ file info.
560
638
 
561
639
  Parameters
562
640
  ----------
563
641
  project : str
564
- Project name.
642
+ The project name to list entities from.
565
643
  entity_type : str
566
- Entity type.
644
+ The type of entities to list.
567
645
  **kwargs : dict
568
- Parameters to pass to the API call.
646
+ Additional parameters to pass to the API call for filtering
647
+ or pagination.
569
648
 
570
649
  Returns
571
650
  -------
572
651
  list[ContextEntity]
573
- List of object instances.
652
+ List of context entity objects (latest versions only).
574
653
  """
575
654
  context = get_context_from_project(project)
576
655
  objs = self._list_context_entities(context, entity_type, **kwargs)
@@ -586,17 +665,20 @@ class ContextEntityOperationsProcessor:
586
665
  new_obj: MaterialEntity,
587
666
  ) -> dict:
588
667
  """
589
- Update material object shortcut.
668
+ Update a material entity using a shortcut method.
669
+
670
+ Convenience method for updating material entities during
671
+ file upload operations.
590
672
 
591
673
  Parameters
592
674
  ----------
593
675
  new_obj : MaterialEntity
594
- Object instance.
676
+ The material entity object to update.
595
677
 
596
678
  Returns
597
679
  -------
598
680
  dict
599
- Response from backend.
681
+ Response data from the backend update operation.
600
682
  """
601
683
  return self.update_context_entity(
602
684
  new_obj.project,
@@ -614,25 +696,29 @@ class ContextEntityOperationsProcessor:
614
696
  **kwargs,
615
697
  ) -> dict:
616
698
  """
617
- Update object. Note that object spec are immutable.
699
+ Update a context entity in the backend.
700
+
701
+ Updates an existing context entity with new data. Entity
702
+ specifications are typically immutable, so this primarily
703
+ updates status and metadata.
618
704
 
619
705
  Parameters
620
706
  ----------
621
707
  context : Context
622
- Context instance.
708
+ The project context instance.
623
709
  entity_type : str
624
- Entity type.
710
+ The type of entity to update.
625
711
  entity_id : str
626
- Entity ID.
712
+ The unique identifier of the entity to update.
627
713
  entity_dict : dict
628
- Entity dictionary.
714
+ The updated entity data dictionary.
629
715
  **kwargs : dict
630
- Parameters to pass to the API call.
716
+ Additional parameters to pass to the API call.
631
717
 
632
718
  Returns
633
719
  -------
634
720
  dict
635
- Response from backend.
721
+ Response data from the backend update operation.
636
722
  """
637
723
  api = context.client.build_api(
638
724
  ApiCategories.CONTEXT.value,
@@ -652,25 +738,29 @@ class ContextEntityOperationsProcessor:
652
738
  **kwargs,
653
739
  ) -> ContextEntity:
654
740
  """
655
- Update object. Note that object spec are immutable.
741
+ Update a context entity in the backend.
742
+
743
+ Updates an existing context entity with new data and returns
744
+ the updated context entity object. Entity specifications are
745
+ typically immutable.
656
746
 
657
747
  Parameters
658
748
  ----------
659
749
  project : str
660
- Project name.
750
+ The project name containing the entity.
661
751
  entity_type : str
662
- Entity type.
752
+ The type of entity to update.
663
753
  entity_id : str
664
- Entity ID.
754
+ The unique identifier of the entity to update.
665
755
  entity_dict : dict
666
- Entity dictionary.
756
+ The updated entity data dictionary.
667
757
  **kwargs : dict
668
- Parameters to pass to the API call.
758
+ Additional parameters to pass to the API call.
669
759
 
670
760
  Returns
671
761
  -------
672
762
  ContextEntity
673
- Object instance.
763
+ The updated context entity object.
674
764
  """
675
765
  context = get_context_from_project(project)
676
766
  obj = self._update_context_entity(
@@ -692,27 +782,33 @@ class ContextEntityOperationsProcessor:
692
782
  **kwargs,
693
783
  ) -> dict:
694
784
  """
695
- Delete object from backend.
785
+ Delete a context entity from the backend.
786
+
787
+ Removes an entity from the backend, with options for deleting
788
+ specific versions or all versions of a named entity. Handles
789
+ cascade deletion if supported.
696
790
 
697
791
  Parameters
698
792
  ----------
699
793
  context : Context
700
- Context instance.
794
+ The project context instance.
701
795
  identifier : str
702
- Entity key (store://...) or entity name.
703
- entity_type : str
704
- Entity type.
705
- project : str
706
- Project name.
707
- entity_id : str
708
- Entity ID.
796
+ Entity key (store://...) or entity name identifier.
797
+ entity_type : str, optional
798
+ The type of entity to delete.
799
+ project : str, optional
800
+ Project name (used for identifier parsing).
801
+ entity_id : str, optional
802
+ Specific entity ID to delete.
709
803
  **kwargs : dict
710
- Parameters to pass to the API call.
804
+ Additional parameters including:
805
+ - 'delete_all_versions': delete all versions of named entity
806
+ - 'cascade': cascade deletion options
711
807
 
712
808
  Returns
713
809
  -------
714
810
  dict
715
- Response from backend.
811
+ Response data from the backend delete operation.
716
812
  """
717
813
  project, entity_type, _, entity_name, entity_id = parse_identifier(
718
814
  identifier,
@@ -758,25 +854,28 @@ class ContextEntityOperationsProcessor:
758
854
  **kwargs,
759
855
  ) -> dict:
760
856
  """
761
- Delete object from backend.
857
+ Delete a context entity from the backend.
858
+
859
+ Removes an entity from the backend with support for deleting
860
+ specific versions or all versions of a named entity.
762
861
 
763
862
  Parameters
764
863
  ----------
765
864
  identifier : str
766
- Entity key (store://...) or entity name.
767
- project : str
768
- Project name.
769
- entity_type : str
770
- Entity type.
771
- entity_id : str
772
- Entity ID.
865
+ Entity key (store://...) or entity name identifier.
866
+ project : str, optional
867
+ Project name for context resolution.
868
+ entity_type : str, optional
869
+ The type of entity to delete.
870
+ entity_id : str, optional
871
+ Specific entity ID to delete.
773
872
  **kwargs : dict
774
- Parameters to pass to the API call.
873
+ Additional parameters including deletion options.
775
874
 
776
875
  Returns
777
876
  -------
778
877
  dict
779
- Response from backend.
878
+ Response data from the backend delete operation.
780
879
  """
781
880
  context = get_context_from_identifier(identifier, project)
782
881
  return self._delete_context_entity(
@@ -790,17 +889,20 @@ class ContextEntityOperationsProcessor:
790
889
 
791
890
  def _post_process_get(self, entity: ContextEntity) -> ContextEntity:
792
891
  """
793
- Post process get (files, metrics).
892
+ Post-process a retrieved context entity.
893
+
894
+ Applies additional processing to entities after retrieval,
895
+ including loading metrics and file information if available.
794
896
 
795
897
  Parameters
796
898
  ----------
797
899
  entity : ContextEntity
798
- Entity to post process.
900
+ The entity to post-process.
799
901
 
800
902
  Returns
801
903
  -------
802
904
  ContextEntity
803
- Post processed entity.
905
+ The post-processed entity with additional data loaded.
804
906
  """
805
907
  if hasattr(entity.status, "metrics"):
806
908
  entity._get_metrics()
@@ -821,25 +923,28 @@ class ContextEntityOperationsProcessor:
821
923
  entity_id: str | None = None,
822
924
  ) -> str:
823
925
  """
824
- Build object key.
926
+ Build a storage key for a context entity.
927
+
928
+ Creates a standardized key string for context entity identification
929
+ and storage within a project context.
825
930
 
826
931
  Parameters
827
932
  ----------
828
933
  context : Context
829
- Context instance.
934
+ The project context instance.
830
935
  entity_type : str
831
- Entity type.
936
+ The type of entity.
832
937
  entity_kind : str
833
- Entity kind.
938
+ The kind/subtype of entity.
834
939
  entity_name : str
835
- Entity name.
836
- entity_id : str
837
- Entity ID.
940
+ The name of the entity.
941
+ entity_id : str, optional
942
+ The unique identifier of the entity version.
838
943
 
839
944
  Returns
840
945
  -------
841
946
  str
842
- Object key.
947
+ The constructed context entity key string.
843
948
  """
844
949
  return context.client.build_key(
845
950
  ApiCategories.CONTEXT.value,
@@ -859,25 +964,28 @@ class ContextEntityOperationsProcessor:
859
964
  entity_id: str | None = None,
860
965
  ) -> str:
861
966
  """
862
- Build object key.
967
+ Build a storage key for a context entity.
968
+
969
+ Creates a standardized key string for context entity identification
970
+ and storage, resolving the project context automatically.
863
971
 
864
972
  Parameters
865
973
  ----------
866
974
  project : str
867
- Project name.
975
+ The project name containing the entity.
868
976
  entity_type : str
869
- Entity type.
977
+ The type of entity.
870
978
  entity_kind : str
871
- Entity kind.
979
+ The kind/subtype of entity.
872
980
  entity_name : str
873
- Entity name.
874
- entity_id : str
875
- Entity ID.
981
+ The name of the entity.
982
+ entity_id : str, optional
983
+ The unique identifier of the entity version.
876
984
 
877
985
  Returns
878
986
  -------
879
987
  str
880
- Object key.
988
+ The constructed context entity key string.
881
989
  """
882
990
  context = get_context_from_project(project)
883
991
  return self._build_context_entity_key(context, entity_type, entity_kind, entity_name, entity_id)
@@ -889,21 +997,24 @@ class ContextEntityOperationsProcessor:
889
997
  **kwargs,
890
998
  ) -> dict:
891
999
  """
892
- Get data from backend.
1000
+ Read secret data from the backend.
1001
+
1002
+ Retrieves secret data stored in the backend for a specific
1003
+ project and entity type.
893
1004
 
894
1005
  Parameters
895
1006
  ----------
896
1007
  project : str
897
- Project name.
1008
+ The project name containing the secrets.
898
1009
  entity_type : str
899
- Entity type.
1010
+ The type of entity (typically 'secret').
900
1011
  **kwargs : dict
901
- Parameters to pass to the API call.
1012
+ Additional parameters to pass to the API call.
902
1013
 
903
1014
  Returns
904
1015
  -------
905
1016
  dict
906
- Response from backend.
1017
+ Secret data retrieved from the backend.
907
1018
  """
908
1019
  context = get_context_from_project(project)
909
1020
  api = context.client.build_api(
@@ -922,18 +1033,21 @@ class ContextEntityOperationsProcessor:
922
1033
  **kwargs,
923
1034
  ) -> None:
924
1035
  """
925
- Set data in backend.
1036
+ Update secret data in the backend.
1037
+
1038
+ Stores or updates secret data in the backend for a specific
1039
+ project and entity type.
926
1040
 
927
1041
  Parameters
928
1042
  ----------
929
1043
  project : str
930
- Project name.
1044
+ The project name to store secrets in.
931
1045
  entity_type : str
932
- Entity type.
1046
+ The type of entity (typically 'secret').
933
1047
  data : dict
934
- Data dictionary.
1048
+ The secret data dictionary to store.
935
1049
  **kwargs : dict
936
- Parameters to pass to the API call.
1050
+ Additional parameters to pass to the API call.
937
1051
 
938
1052
  Returns
939
1053
  -------
@@ -956,23 +1070,26 @@ class ContextEntityOperationsProcessor:
956
1070
  **kwargs,
957
1071
  ) -> dict:
958
1072
  """
959
- Get logs from backend.
1073
+ Read execution logs from the backend.
1074
+
1075
+ Retrieves logs for a specific run or task execution from
1076
+ the backend.
960
1077
 
961
1078
  Parameters
962
1079
  ----------
963
1080
  project : str
964
- Project name.
1081
+ The project name containing the entity.
965
1082
  entity_type : str
966
- Entity type.
1083
+ The type of entity (typically 'run' or 'task').
967
1084
  entity_id : str
968
- Entity ID.
1085
+ The unique identifier of the entity to get logs for.
969
1086
  **kwargs : dict
970
- Parameters to pass to the API call.
1087
+ Additional parameters to pass to the API call.
971
1088
 
972
1089
  Returns
973
1090
  -------
974
1091
  dict
975
- Response from backend.
1092
+ Log data retrieved from the backend.
976
1093
  """
977
1094
  context = get_context_from_project(project)
978
1095
  api = context.client.build_api(
@@ -992,18 +1109,21 @@ class ContextEntityOperationsProcessor:
992
1109
  **kwargs,
993
1110
  ) -> None:
994
1111
  """
995
- Stop object in backend.
1112
+ Stop a running entity in the backend.
1113
+
1114
+ Sends a stop signal to halt execution of a running entity
1115
+ such as a workflow or long-running task.
996
1116
 
997
1117
  Parameters
998
1118
  ----------
999
1119
  project : str
1000
- Project name.
1120
+ The project name containing the entity.
1001
1121
  entity_type : str
1002
- Entity type.
1122
+ The type of entity to stop.
1003
1123
  entity_id : str
1004
- Entity ID.
1124
+ The unique identifier of the entity to stop.
1005
1125
  **kwargs : dict
1006
- Parameters to pass to the API call.
1126
+ Additional parameters to pass to the API call.
1007
1127
 
1008
1128
  Returns
1009
1129
  -------
@@ -1027,18 +1147,21 @@ class ContextEntityOperationsProcessor:
1027
1147
  **kwargs,
1028
1148
  ) -> None:
1029
1149
  """
1030
- Resume object in backend.
1150
+ Resume a stopped entity in the backend.
1151
+
1152
+ Sends a resume signal to restart execution of a previously
1153
+ stopped entity such as a workflow or task.
1031
1154
 
1032
1155
  Parameters
1033
1156
  ----------
1034
1157
  project : str
1035
- Project name.
1158
+ The project name containing the entity.
1036
1159
  entity_type : str
1037
- Entity type.
1160
+ The type of entity to resume.
1038
1161
  entity_id : str
1039
- Entity ID.
1162
+ The unique identifier of the entity to resume.
1040
1163
  **kwargs : dict
1041
- Parameters to pass to the API call.
1164
+ Additional parameters to pass to the API call.
1042
1165
 
1043
1166
  Returns
1044
1167
  -------
@@ -1062,23 +1185,26 @@ class ContextEntityOperationsProcessor:
1062
1185
  **kwargs,
1063
1186
  ) -> list[dict]:
1064
1187
  """
1065
- Get files info from backend.
1188
+ Read file information from the backend.
1189
+
1190
+ Retrieves metadata about files associated with an entity,
1191
+ including file paths, sizes, and other attributes.
1066
1192
 
1067
1193
  Parameters
1068
1194
  ----------
1069
1195
  project : str
1070
- Project name.
1196
+ The project name containing the entity.
1071
1197
  entity_type : str
1072
- Entity type.
1198
+ The type of entity to get file info for.
1073
1199
  entity_id : str
1074
- Entity ID.
1200
+ The unique identifier of the entity.
1075
1201
  **kwargs : dict
1076
- Parameters to pass to the API call.
1202
+ Additional parameters to pass to the API call.
1077
1203
 
1078
1204
  Returns
1079
1205
  -------
1080
1206
  list[dict]
1081
- Response from backend.
1207
+ List of file information dictionaries from the backend.
1082
1208
  """
1083
1209
  context = get_context_from_project(project)
1084
1210
  api = context.client.build_api(
@@ -1137,23 +1263,30 @@ class ContextEntityOperationsProcessor:
1137
1263
  **kwargs,
1138
1264
  ) -> dict:
1139
1265
  """
1140
- Get metrics from backend.
1266
+ Read metrics from the backend for a specific entity.
1267
+
1268
+ Retrieves metrics data associated with an entity. Can fetch either
1269
+ all metrics or a specific metric by name. Used for performance
1270
+ monitoring and analysis of entity operations.
1141
1271
 
1142
1272
  Parameters
1143
1273
  ----------
1144
1274
  project : str
1145
- Project name.
1275
+ The project name containing the entity.
1146
1276
  entity_type : str
1147
- Entity type.
1277
+ The type of entity to read metrics from.
1148
1278
  entity_id : str
1149
- Entity ID.
1279
+ The unique identifier of the entity.
1280
+ metric_name : str, optional
1281
+ The name of a specific metric to retrieve.
1282
+ If None, retrieves all available metrics.
1150
1283
  **kwargs : dict
1151
- Parameters to pass to the API call.
1284
+ Additional parameters to pass to the API call.
1152
1285
 
1153
1286
  Returns
1154
1287
  -------
1155
1288
  dict
1156
- Response from backend.
1289
+ Dictionary containing metric data from the backend.
1157
1290
  """
1158
1291
  context = get_context_from_project(project)
1159
1292
  api = context.client.build_api(
@@ -1176,18 +1309,27 @@ class ContextEntityOperationsProcessor:
1176
1309
  **kwargs,
1177
1310
  ) -> None:
1178
1311
  """
1179
- Get single metric from backend.
1312
+ Update or create a metric value for an entity in the backend.
1313
+
1314
+ Updates an existing metric or creates a new one with the specified
1315
+ value. Metrics are used for tracking performance, status, and
1316
+ other quantitative aspects of entity operations.
1180
1317
 
1181
1318
  Parameters
1182
1319
  ----------
1183
1320
  project : str
1184
- Project name.
1321
+ The project name containing the entity.
1185
1322
  entity_type : str
1186
- Entity type.
1323
+ The type of entity to update metrics for.
1187
1324
  entity_id : str
1188
- Entity ID.
1325
+ The unique identifier of the entity.
1326
+ metric_name : str
1327
+ The name of the metric to update or create.
1328
+ metric_value : Any
1329
+ The value to set for the metric.
1330
+ Can be numeric, string, or other supported types.
1189
1331
  **kwargs : dict
1190
- Parameters to pass to the API call.
1332
+ Additional parameters to pass to the API call.
1191
1333
 
1192
1334
  Returns
1193
1335
  -------
@@ -1210,19 +1352,23 @@ class ContextEntityOperationsProcessor:
1210
1352
  **kwargs,
1211
1353
  ) -> dict:
1212
1354
  """
1213
- Search in backend.
1355
+ Execute search query against the backend API.
1356
+
1357
+ Internal method that performs the actual search operation
1358
+ by building API parameters, executing the search request,
1359
+ and processing the results into entity objects.
1214
1360
 
1215
1361
  Parameters
1216
1362
  ----------
1217
1363
  context : Context
1218
- Context instance.
1364
+ The context instance containing client and project information.
1219
1365
  **kwargs : dict
1220
- Parameters to pass to the API call.
1366
+ Search parameters and filters to pass to the API call.
1221
1367
 
1222
1368
  Returns
1223
1369
  -------
1224
1370
  dict
1225
- Response from backend.
1371
+ List of context entity objects matching the search criteria.
1226
1372
  """
1227
1373
  kwargs = context.client.build_parameters(
1228
1374
  ApiCategories.CONTEXT.value,
@@ -1251,35 +1397,40 @@ class ContextEntityOperationsProcessor:
1251
1397
  **kwargs,
1252
1398
  ) -> list[ContextEntity]:
1253
1399
  """
1254
- Search objects from backend.
1400
+ Search for entities in the backend using various criteria.
1401
+
1402
+ Performs a flexible search across multiple entity attributes,
1403
+ allowing for complex queries and filtering. Returns matching
1404
+ entities from the project context.
1255
1405
 
1256
1406
  Parameters
1257
1407
  ----------
1258
1408
  project : str
1259
- Project name.
1260
- query : str
1261
- Search query.
1262
- entity_types : list[str]
1263
- Entity types.
1264
- name : str
1265
- Entity name.
1266
- kind : str
1267
- Entity kind.
1268
- created : str
1269
- Entity creation date.
1270
- updated : str
1271
- Entity update date.
1272
- description : str
1273
- Entity description.
1274
- labels : list[str]
1275
- Entity labels.
1409
+ The project name to search within.
1410
+ query : str, optional
1411
+ Free-text search query to match against entity content.
1412
+ entity_types : list[str], optional
1413
+ List of entity types to filter by.
1414
+ If None, searches all entity types.
1415
+ name : str, optional
1416
+ Entity name pattern to match.
1417
+ kind : str, optional
1418
+ Entity kind to filter by.
1419
+ created : str, optional
1420
+ Creation date filter (ISO format).
1421
+ updated : str, optional
1422
+ Last update date filter (ISO format).
1423
+ description : str, optional
1424
+ Description pattern to match.
1425
+ labels : list[str], optional
1426
+ List of label patterns to match.
1276
1427
  **kwargs : dict
1277
- Parameters to pass to the API call.
1428
+ Additional search parameters to pass to the API call.
1278
1429
 
1279
1430
  Returns
1280
1431
  -------
1281
1432
  list[ContextEntity]
1282
- List of object instances.
1433
+ List of matching entity instances from the search.
1283
1434
  """
1284
1435
  context = get_context_from_project(project)
1285
1436
  return self._search(