digitalhub 0.14.0b2__py3-none-any.whl → 0.14.0b4__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.

Files changed (75) hide show
  1. digitalhub/context/builder.py +0 -4
  2. digitalhub/context/context.py +12 -8
  3. digitalhub/entities/_base/_base/entity.py +0 -4
  4. digitalhub/entities/_base/context/entity.py +1 -1
  5. digitalhub/entities/_base/entity/entity.py +0 -8
  6. digitalhub/entities/_base/executable/entity.py +161 -79
  7. digitalhub/entities/_base/material/entity.py +7 -23
  8. digitalhub/entities/_base/material/utils.py +28 -0
  9. digitalhub/entities/_base/unversioned/entity.py +1 -1
  10. digitalhub/entities/_base/versioned/entity.py +1 -1
  11. digitalhub/entities/_commons/enums.py +0 -31
  12. digitalhub/entities/_constructors/_resources.py +151 -0
  13. digitalhub/entities/_constructors/name.py +18 -0
  14. digitalhub/entities/_processors/base/__init__.py +3 -0
  15. digitalhub/entities/_processors/{base.py → base/crud.py} +7 -227
  16. digitalhub/entities/_processors/base/import_export.py +122 -0
  17. digitalhub/entities/_processors/base/processor.py +302 -0
  18. digitalhub/entities/_processors/base/special_ops.py +108 -0
  19. digitalhub/entities/_processors/context/__init__.py +3 -0
  20. digitalhub/entities/_processors/context/crud.py +654 -0
  21. digitalhub/entities/_processors/context/import_export.py +242 -0
  22. digitalhub/entities/_processors/context/material.py +123 -0
  23. digitalhub/entities/_processors/context/processor.py +400 -0
  24. digitalhub/entities/_processors/context/special_ops.py +476 -0
  25. digitalhub/entities/_processors/processors.py +12 -0
  26. digitalhub/entities/_processors/utils.py +2 -1
  27. digitalhub/entities/artifact/crud.py +45 -41
  28. digitalhub/entities/dataitem/crud.py +45 -37
  29. digitalhub/entities/dataitem/table/entity.py +5 -6
  30. digitalhub/entities/function/crud.py +47 -43
  31. digitalhub/entities/model/_base/entity.py +3 -23
  32. digitalhub/entities/model/crud.py +45 -39
  33. digitalhub/entities/project/_base/entity.py +45 -134
  34. digitalhub/entities/project/crud.py +13 -42
  35. digitalhub/entities/run/_base/builder.py +0 -4
  36. digitalhub/entities/run/_base/entity.py +4 -60
  37. digitalhub/entities/run/crud.py +61 -40
  38. digitalhub/entities/secret/_base/entity.py +1 -5
  39. digitalhub/entities/secret/crud.py +14 -42
  40. digitalhub/entities/task/_base/builder.py +0 -4
  41. digitalhub/entities/task/_base/entity.py +1 -1
  42. digitalhub/entities/task/crud.py +47 -44
  43. digitalhub/entities/trigger/_base/entity.py +1 -5
  44. digitalhub/entities/trigger/crud.py +51 -43
  45. digitalhub/entities/workflow/crud.py +47 -40
  46. digitalhub/factory/registry.py +0 -24
  47. digitalhub/stores/client/_base/enums.py +39 -0
  48. digitalhub/stores/client/_base/key_builder.py +1 -1
  49. digitalhub/stores/client/_base/params_builder.py +48 -0
  50. digitalhub/stores/client/dhcore/api_builder.py +2 -1
  51. digitalhub/stores/client/dhcore/client.py +67 -73
  52. digitalhub/stores/client/dhcore/configurator.py +5 -28
  53. digitalhub/stores/client/dhcore/error_parser.py +0 -4
  54. digitalhub/stores/client/dhcore/params_builder.py +130 -75
  55. digitalhub/stores/client/local/api_builder.py +1 -1
  56. digitalhub/stores/client/local/params_builder.py +18 -41
  57. digitalhub/stores/credentials/configurator.py +0 -24
  58. digitalhub/stores/credentials/handler.py +0 -12
  59. digitalhub/stores/credentials/store.py +0 -4
  60. digitalhub/stores/data/_base/store.py +0 -16
  61. digitalhub/stores/data/builder.py +0 -4
  62. digitalhub/stores/data/remote/store.py +0 -4
  63. digitalhub/stores/data/s3/configurator.py +0 -8
  64. digitalhub/stores/data/s3/store.py +8 -17
  65. digitalhub/stores/data/sql/configurator.py +0 -8
  66. digitalhub/stores/data/sql/store.py +0 -4
  67. digitalhub/stores/readers/data/factory.py +0 -8
  68. digitalhub/stores/readers/data/pandas/reader.py +0 -16
  69. digitalhub/utils/io_utils.py +0 -4
  70. {digitalhub-0.14.0b2.dist-info → digitalhub-0.14.0b4.dist-info}/METADATA +1 -1
  71. {digitalhub-0.14.0b2.dist-info → digitalhub-0.14.0b4.dist-info}/RECORD +74 -62
  72. digitalhub/entities/_processors/context.py +0 -1499
  73. {digitalhub-0.14.0b2.dist-info → digitalhub-0.14.0b4.dist-info}/WHEEL +0 -0
  74. {digitalhub-0.14.0b2.dist-info → digitalhub-0.14.0b4.dist-info}/licenses/AUTHORS +0 -0
  75. {digitalhub-0.14.0b2.dist-info → digitalhub-0.14.0b4.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,654 @@
1
+ # SPDX-FileCopyrightText: © 2025 DSLab - Fondazione Bruno Kessler
2
+ #
3
+ # SPDX-License-Identifier: Apache-2.0
4
+
5
+ from __future__ import annotations
6
+
7
+ import typing
8
+
9
+ from digitalhub.entities._commons.utils import is_valid_key
10
+ from digitalhub.entities._processors.utils import (
11
+ get_context_from_identifier,
12
+ get_context_from_project,
13
+ parse_identifier,
14
+ )
15
+ from digitalhub.factory.entity import entity_factory
16
+ from digitalhub.stores.client._base.enums import ApiCategories, BackendOperations
17
+
18
+ if typing.TYPE_CHECKING:
19
+ from digitalhub.context.context import Context
20
+ from digitalhub.entities._base.context.entity import ContextEntity
21
+ from digitalhub.entities._base.unversioned.entity import UnversionedEntity
22
+
23
+
24
+ class ContextEntityCRUDProcessor:
25
+ """
26
+ Processor for core CRUD operations on context entities.
27
+
28
+ Handles creation, reading, updating, deletion, and listing of
29
+ context-level entities within projects.
30
+ """
31
+
32
+ def _create_context_entity(
33
+ self,
34
+ context: Context,
35
+ entity_type: str,
36
+ entity_dict: dict,
37
+ ) -> dict:
38
+ """
39
+ Create a context entity in the backend.
40
+
41
+ Builds the appropriate API endpoint and sends a create request
42
+ to the backend for context-level entities within a project.
43
+
44
+ Parameters
45
+ ----------
46
+ context : Context
47
+ The project context instance.
48
+ entity_type : str
49
+ The type of entity to create (e.g., 'artifact', 'function').
50
+ entity_dict : dict
51
+ The entity data dictionary to create.
52
+
53
+ Returns
54
+ -------
55
+ dict
56
+ The created entity data returned from the backend.
57
+ """
58
+ api = context.client.build_api(
59
+ ApiCategories.CONTEXT.value,
60
+ BackendOperations.CREATE.value,
61
+ project=context.name,
62
+ entity_type=entity_type,
63
+ )
64
+ return context.client.create_object(api, entity_dict)
65
+
66
+ def create_context_entity(
67
+ self,
68
+ _entity: ContextEntity | None = None,
69
+ **kwargs,
70
+ ) -> ContextEntity:
71
+ """
72
+ Create a context entity in the backend.
73
+
74
+ Creates a new context entity either from an existing entity object
75
+ or by building one from the provided parameters. Handles entity
76
+ creation within a project context.
77
+
78
+ Parameters
79
+ ----------
80
+ _entity : ContextEntity, optional
81
+ An existing context entity object to create. If None,
82
+ a new entity will be built from kwargs.
83
+ **kwargs : dict
84
+ Parameters for entity creation, including 'project' and
85
+ entity-specific parameters.
86
+
87
+ Returns
88
+ -------
89
+ ContextEntity
90
+ The created context entity with backend data populated.
91
+ """
92
+ if _entity is not None:
93
+ context = _entity._context()
94
+ obj = _entity
95
+ else:
96
+ context = get_context_from_project(kwargs["project"])
97
+ obj: ContextEntity = entity_factory.build_entity_from_params(**kwargs)
98
+ new_obj = self._create_context_entity(context, obj.ENTITY_TYPE, obj.to_dict())
99
+ return entity_factory.build_entity_from_dict(new_obj)
100
+
101
+ def _read_context_entity(
102
+ self,
103
+ context: Context,
104
+ identifier: str,
105
+ entity_type: str | None = None,
106
+ project: str | None = None,
107
+ entity_id: str | None = None,
108
+ **kwargs,
109
+ ) -> dict:
110
+ """
111
+ Read a context entity from the backend.
112
+
113
+ Retrieves entity data from the backend using either entity ID
114
+ for direct access or entity name for latest version lookup.
115
+ Handles both specific version reads and latest version queries.
116
+
117
+ Parameters
118
+ ----------
119
+ context : Context
120
+ The project context instance.
121
+ identifier : str
122
+ Entity key (store://...) or entity name identifier.
123
+ entity_type : str, optional
124
+ The type of entity to read.
125
+ project : str, optional
126
+ Project name (used for identifier parsing).
127
+ entity_id : str, optional
128
+ Specific entity ID to read.
129
+ **kwargs : dict
130
+ Additional parameters to pass to the API call.
131
+
132
+ Returns
133
+ -------
134
+ dict
135
+ The entity data retrieved from the backend.
136
+ """
137
+ project, entity_type, _, entity_name, entity_id = parse_identifier(
138
+ identifier,
139
+ project=project,
140
+ entity_type=entity_type,
141
+ entity_id=entity_id,
142
+ )
143
+
144
+ if entity_id is None:
145
+ kwargs["name"] = entity_name
146
+ kwargs = context.client.build_parameters(
147
+ ApiCategories.CONTEXT.value,
148
+ BackendOperations.READ.value,
149
+ **kwargs,
150
+ )
151
+
152
+ if entity_id is None:
153
+ api = context.client.build_api(
154
+ ApiCategories.CONTEXT.value,
155
+ BackendOperations.LIST.value,
156
+ project=context.name,
157
+ entity_type=entity_type,
158
+ )
159
+ return context.client.list_first_object(api, **kwargs)
160
+
161
+ api = context.client.build_api(
162
+ ApiCategories.CONTEXT.value,
163
+ BackendOperations.READ.value,
164
+ project=context.name,
165
+ entity_type=entity_type,
166
+ entity_id=entity_id,
167
+ )
168
+ return context.client.read_object(api, **kwargs)
169
+
170
+ def read_context_entity(
171
+ self,
172
+ identifier: str,
173
+ entity_type: str | None = None,
174
+ project: str | None = None,
175
+ entity_id: str | None = None,
176
+ **kwargs,
177
+ ) -> ContextEntity:
178
+ """
179
+ Read a context entity from the backend.
180
+
181
+ Retrieves entity data from the backend and constructs a context
182
+ entity object. Handles post-processing for metrics and file info.
183
+
184
+ Parameters
185
+ ----------
186
+ identifier : str
187
+ Entity key (store://...) or entity name identifier.
188
+ entity_type : str, optional
189
+ The type of entity to read.
190
+ project : str, optional
191
+ Project name for context resolution.
192
+ entity_id : str, optional
193
+ Specific entity ID to read.
194
+ **kwargs : dict
195
+ Additional parameters to pass to the API call.
196
+
197
+ Returns
198
+ -------
199
+ ContextEntity
200
+ The context entity object populated with backend data.
201
+ """
202
+ context = get_context_from_identifier(identifier, project)
203
+ obj = self._read_context_entity(
204
+ context,
205
+ identifier,
206
+ entity_type=entity_type,
207
+ project=project,
208
+ entity_id=entity_id,
209
+ **kwargs,
210
+ )
211
+ entity = entity_factory.build_entity_from_dict(obj)
212
+ return self._post_process_get(entity)
213
+
214
+ def read_unversioned_entity(
215
+ self,
216
+ identifier: str,
217
+ entity_type: str | None = None,
218
+ project: str | None = None,
219
+ entity_id: str | None = None,
220
+ **kwargs,
221
+ ) -> UnversionedEntity:
222
+ """
223
+ Read an unversioned entity from the backend.
224
+
225
+ Retrieves unversioned entity data (runs, tasks) from the backend.
226
+ Handles identifier parsing for entities that don't follow the
227
+ standard versioned naming convention.
228
+
229
+ Parameters
230
+ ----------
231
+ identifier : str
232
+ Entity key (store://...) or entity ID.
233
+ entity_type : str, optional
234
+ The type of entity to read.
235
+ project : str, optional
236
+ Project name for context resolution.
237
+ entity_id : str, optional
238
+ Specific entity ID to read.
239
+ **kwargs : dict
240
+ Additional parameters to pass to the API call.
241
+
242
+ Returns
243
+ -------
244
+ UnversionedEntity
245
+ The unversioned entity object populated with backend data.
246
+ """
247
+ if not is_valid_key(identifier):
248
+ entity_id = identifier
249
+ else:
250
+ splt = identifier.split(":")
251
+ if len(splt) == 3:
252
+ identifier = f"{splt[0]}:{splt[1]}"
253
+ return self.read_context_entity(
254
+ identifier,
255
+ entity_type=entity_type,
256
+ project=project,
257
+ entity_id=entity_id,
258
+ **kwargs,
259
+ )
260
+
261
+ def _read_context_entity_versions(
262
+ self,
263
+ context: Context,
264
+ identifier: str,
265
+ entity_type: str | None = None,
266
+ project: str | None = None,
267
+ **kwargs,
268
+ ) -> list[dict]:
269
+ """
270
+ Read all versions of a context entity from the backend.
271
+
272
+ Retrieves all available versions of a named entity from the
273
+ backend using the entity name identifier.
274
+
275
+ Parameters
276
+ ----------
277
+ context : Context
278
+ The project context instance.
279
+ identifier : str
280
+ Entity key (store://...) or entity name identifier.
281
+ entity_type : str, optional
282
+ The type of entity to read versions for.
283
+ project : str, optional
284
+ Project name (used for identifier parsing).
285
+ **kwargs : dict
286
+ Additional parameters to pass to the API call.
287
+
288
+ Returns
289
+ -------
290
+ list[dict]
291
+ List of entity data dictionaries for all versions.
292
+ """
293
+ project, entity_type, _, entity_name, _ = parse_identifier(
294
+ identifier,
295
+ project=project,
296
+ entity_type=entity_type,
297
+ )
298
+
299
+ kwargs = context.client.build_parameters(
300
+ ApiCategories.CONTEXT.value,
301
+ BackendOperations.READ_ALL_VERSIONS.value,
302
+ name=entity_name,
303
+ **kwargs,
304
+ )
305
+
306
+ api = context.client.build_api(
307
+ ApiCategories.CONTEXT.value,
308
+ BackendOperations.LIST.value,
309
+ project=context.name,
310
+ entity_type=entity_type,
311
+ )
312
+ return context.client.list_objects(api, **kwargs)
313
+
314
+ def read_context_entity_versions(
315
+ self,
316
+ identifier: str,
317
+ entity_type: str | None = None,
318
+ project: str | None = None,
319
+ **kwargs,
320
+ ) -> list[ContextEntity]:
321
+ """
322
+ Read all versions of a context entity from the backend.
323
+
324
+ Retrieves all available versions of a named entity and constructs
325
+ context entity objects for each version. Applies post-processing
326
+ for metrics and file info.
327
+
328
+ Parameters
329
+ ----------
330
+ identifier : str
331
+ Entity key (store://...) or entity name identifier.
332
+ entity_type : str, optional
333
+ The type of entity to read versions for.
334
+ project : str, optional
335
+ Project name for context resolution.
336
+ **kwargs : dict
337
+ Additional parameters to pass to the API call.
338
+
339
+ Returns
340
+ -------
341
+ list[ContextEntity]
342
+ List of context entity objects for all versions.
343
+ """
344
+ context = get_context_from_identifier(identifier, project)
345
+ objs = self._read_context_entity_versions(
346
+ context,
347
+ identifier,
348
+ entity_type=entity_type,
349
+ project=project,
350
+ **kwargs,
351
+ )
352
+ objects = []
353
+ for o in objs:
354
+ entity: ContextEntity = entity_factory.build_entity_from_dict(o)
355
+ entity = self._post_process_get(entity)
356
+ objects.append(entity)
357
+ return objects
358
+
359
+ def _list_context_entities(
360
+ self,
361
+ context: Context,
362
+ entity_type: str,
363
+ **kwargs,
364
+ ) -> list[dict]:
365
+ """
366
+ List context entities from the backend.
367
+
368
+ Retrieves a list of entities of a specific type from the backend
369
+ within the project context.
370
+
371
+ Parameters
372
+ ----------
373
+ context : Context
374
+ The project context instance.
375
+ entity_type : str
376
+ The type of entities to list.
377
+ **kwargs : dict
378
+ Additional parameters to pass to the API call for filtering
379
+ or pagination.
380
+
381
+ Returns
382
+ -------
383
+ list[dict]
384
+ List of entity data dictionaries from the backend.
385
+ """
386
+ kwargs = context.client.build_parameters(
387
+ ApiCategories.CONTEXT.value,
388
+ BackendOperations.LIST.value,
389
+ **kwargs,
390
+ )
391
+ api = context.client.build_api(
392
+ ApiCategories.CONTEXT.value,
393
+ BackendOperations.LIST.value,
394
+ project=context.name,
395
+ entity_type=entity_type,
396
+ )
397
+ return context.client.list_objects(api, **kwargs)
398
+
399
+ def list_context_entities(
400
+ self,
401
+ project: str,
402
+ entity_type: str,
403
+ **kwargs,
404
+ ) -> list[ContextEntity]:
405
+ """
406
+ List all latest version context entities from the backend.
407
+
408
+ Retrieves a list of entities of a specific type from the backend
409
+ and constructs context entity objects. Only returns the latest
410
+ version of each entity. Applies post-processing for metrics and
411
+ file info.
412
+
413
+ Parameters
414
+ ----------
415
+ project : str
416
+ The project name to list entities from.
417
+ entity_type : str
418
+ The type of entities to list.
419
+ **kwargs : dict
420
+ Additional parameters to pass to the API call for filtering
421
+ or pagination.
422
+
423
+ Returns
424
+ -------
425
+ list[ContextEntity]
426
+ List of context entity objects (latest versions only).
427
+ """
428
+ context = get_context_from_project(project)
429
+ objs = self._list_context_entities(context, entity_type, **kwargs)
430
+ objects = []
431
+ for o in objs:
432
+ entity: ContextEntity = entity_factory.build_entity_from_dict(o)
433
+ entity = self._post_process_get(entity)
434
+ objects.append(entity)
435
+ return objects
436
+
437
+ def _update_context_entity(
438
+ self,
439
+ context: Context,
440
+ entity_type: str,
441
+ entity_id: str,
442
+ entity_dict: dict,
443
+ **kwargs,
444
+ ) -> dict:
445
+ """
446
+ Update a context entity in the backend.
447
+
448
+ Updates an existing context entity with new data. Entity
449
+ specifications are typically immutable, so this primarily
450
+ updates status and metadata.
451
+
452
+ Parameters
453
+ ----------
454
+ context : Context
455
+ The project context instance.
456
+ entity_type : str
457
+ The type of entity to update.
458
+ entity_id : str
459
+ The unique identifier of the entity to update.
460
+ entity_dict : dict
461
+ The updated entity data dictionary.
462
+ **kwargs : dict
463
+ Additional parameters to pass to the API call.
464
+
465
+ Returns
466
+ -------
467
+ dict
468
+ Response data from the backend update operation.
469
+ """
470
+ api = context.client.build_api(
471
+ ApiCategories.CONTEXT.value,
472
+ BackendOperations.UPDATE.value,
473
+ project=context.name,
474
+ entity_type=entity_type,
475
+ entity_id=entity_id,
476
+ )
477
+ return context.client.update_object(api, entity_dict, **kwargs)
478
+
479
+ def update_context_entity(
480
+ self,
481
+ project: str,
482
+ entity_type: str,
483
+ entity_id: str,
484
+ entity_dict: dict,
485
+ **kwargs,
486
+ ) -> ContextEntity:
487
+ """
488
+ Update a context entity in the backend.
489
+
490
+ Updates an existing context entity with new data and returns
491
+ the updated context entity object. Entity specifications are
492
+ typically immutable.
493
+
494
+ Parameters
495
+ ----------
496
+ project : str
497
+ The project name containing the entity.
498
+ entity_type : str
499
+ The type of entity to update.
500
+ entity_id : str
501
+ The unique identifier of the entity to update.
502
+ entity_dict : dict
503
+ The updated entity data dictionary.
504
+ **kwargs : dict
505
+ Additional parameters to pass to the API call.
506
+
507
+ Returns
508
+ -------
509
+ ContextEntity
510
+ The updated context entity object.
511
+ """
512
+ context = get_context_from_project(project)
513
+ obj = self._update_context_entity(
514
+ context,
515
+ entity_type,
516
+ entity_id,
517
+ entity_dict,
518
+ **kwargs,
519
+ )
520
+ return entity_factory.build_entity_from_dict(obj)
521
+
522
+ def _delete_context_entity(
523
+ self,
524
+ context: Context,
525
+ identifier: str,
526
+ entity_type: str | None = None,
527
+ project: str | None = None,
528
+ entity_id: str | None = None,
529
+ **kwargs,
530
+ ) -> dict:
531
+ """
532
+ Delete a context entity from the backend.
533
+
534
+ Removes an entity from the backend, with options for deleting
535
+ specific versions or all versions of a named entity. Handles
536
+ cascade deletion if supported.
537
+
538
+ Parameters
539
+ ----------
540
+ context : Context
541
+ The project context instance.
542
+ identifier : str
543
+ Entity key (store://...) or entity name identifier.
544
+ entity_type : str, optional
545
+ The type of entity to delete.
546
+ project : str, optional
547
+ Project name (used for identifier parsing).
548
+ entity_id : str, optional
549
+ Specific entity ID to delete.
550
+ **kwargs : dict
551
+ Additional parameters including:
552
+ - 'delete_all_versions': delete all versions of named entity
553
+ - 'cascade': cascade deletion options
554
+
555
+ Returns
556
+ -------
557
+ dict
558
+ Response data from the backend delete operation.
559
+ """
560
+ project, entity_type, _, entity_name, entity_id = parse_identifier(
561
+ identifier,
562
+ project=project,
563
+ entity_type=entity_type,
564
+ entity_id=entity_id,
565
+ )
566
+
567
+ delete_all_versions: bool = kwargs.pop("delete_all_versions", False)
568
+ if delete_all_versions:
569
+ op = BackendOperations.DELETE_ALL_VERSIONS.value
570
+ kwargs["name"] = entity_name
571
+ else:
572
+ if entity_id is None:
573
+ raise ValueError("If `delete_all_versions` is False, `entity_id` must be provided.")
574
+ op = BackendOperations.DELETE.value
575
+
576
+ kwargs = context.client.build_parameters(
577
+ ApiCategories.CONTEXT.value,
578
+ op,
579
+ **kwargs,
580
+ )
581
+
582
+ api = context.client.build_api(
583
+ ApiCategories.CONTEXT.value,
584
+ op,
585
+ project=context.name,
586
+ entity_type=entity_type,
587
+ entity_id=entity_id,
588
+ )
589
+ return context.client.delete_object(api, **kwargs)
590
+
591
+ def delete_context_entity(
592
+ self,
593
+ identifier: str,
594
+ project: str | None = None,
595
+ entity_type: str | None = None,
596
+ entity_id: str | None = None,
597
+ **kwargs,
598
+ ) -> dict:
599
+ """
600
+ Delete a context entity from the backend.
601
+
602
+ Removes an entity from the backend with support for deleting
603
+ specific versions or all versions of a named entity.
604
+
605
+ Parameters
606
+ ----------
607
+ identifier : str
608
+ Entity key (store://...) or entity name identifier.
609
+ project : str, optional
610
+ Project name for context resolution.
611
+ entity_type : str, optional
612
+ The type of entity to delete.
613
+ entity_id : str, optional
614
+ Specific entity ID to delete.
615
+ **kwargs : dict
616
+ Additional parameters including deletion options.
617
+
618
+ Returns
619
+ -------
620
+ dict
621
+ Response data from the backend delete operation.
622
+ """
623
+ context = get_context_from_identifier(identifier, project)
624
+ return self._delete_context_entity(
625
+ context,
626
+ identifier,
627
+ entity_type,
628
+ context.name,
629
+ entity_id,
630
+ **kwargs,
631
+ )
632
+
633
+ def _post_process_get(self, entity: ContextEntity) -> ContextEntity:
634
+ """
635
+ Post-process a retrieved context entity.
636
+
637
+ Applies additional processing to entities after retrieval,
638
+ including loading metrics and file information if available.
639
+
640
+ Parameters
641
+ ----------
642
+ entity : ContextEntity
643
+ The entity to post-process.
644
+
645
+ Returns
646
+ -------
647
+ ContextEntity
648
+ The post-processed entity with additional data loaded.
649
+ """
650
+ if hasattr(entity.status, "metrics"):
651
+ entity._get_metrics()
652
+ if hasattr(entity.status, "files"):
653
+ entity._get_files_info()
654
+ return entity