digitalhub 0.8.0b3__py3-none-any.whl → 0.8.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 (80) hide show
  1. digitalhub/__init__.py +3 -2
  2. digitalhub/client/dhcore/client.py +6 -1
  3. digitalhub/context/builder.py +1 -1
  4. digitalhub/context/context.py +1 -1
  5. digitalhub/entities/_base/entity/entity.py +2 -28
  6. digitalhub/entities/_base/unversioned/builder.py +66 -0
  7. digitalhub/entities/_base/unversioned/entity.py +0 -38
  8. digitalhub/entities/_base/versioned/builder.py +68 -0
  9. digitalhub/entities/_base/versioned/entity.py +0 -41
  10. digitalhub/entities/_builders/entity.py +37 -32
  11. digitalhub/entities/_builders/metadata.py +3 -10
  12. digitalhub/entities/_builders/spec.py +11 -21
  13. digitalhub/entities/_builders/status.py +8 -18
  14. digitalhub/entities/_builders/uuid.py +4 -11
  15. digitalhub/entities/artifact/_base/builder.py +86 -0
  16. digitalhub/entities/artifact/artifact/builder.py +18 -0
  17. digitalhub/entities/artifact/builder.py +15 -97
  18. digitalhub/entities/artifact/crud.py +1 -1
  19. digitalhub/entities/builders.py +63 -0
  20. digitalhub/entities/dataitem/_base/builder.py +86 -0
  21. digitalhub/entities/dataitem/builder.py +15 -108
  22. digitalhub/entities/dataitem/crud.py +3 -3
  23. digitalhub/entities/dataitem/dataitem/builder.py +18 -0
  24. digitalhub/entities/dataitem/iceberg/builder.py +18 -0
  25. digitalhub/entities/dataitem/table/builder.py +18 -0
  26. digitalhub/entities/function/_base/builder.py +78 -0
  27. digitalhub/entities/function/_base/entity.py +2 -2
  28. digitalhub/entities/function/builder.py +22 -57
  29. digitalhub/entities/function/crud.py +1 -1
  30. digitalhub/entities/model/_base/builder.py +86 -0
  31. digitalhub/entities/model/builder.py +15 -116
  32. digitalhub/entities/model/crud.py +1 -1
  33. digitalhub/entities/model/huggingface/builder.py +18 -0
  34. digitalhub/entities/model/mlflow/builder.py +18 -0
  35. digitalhub/entities/model/model/builder.py +18 -0
  36. digitalhub/entities/model/sklearn/builder.py +18 -0
  37. digitalhub/entities/project/_base/builder.py +128 -0
  38. digitalhub/entities/project/{project → _base}/entity.py +9 -51
  39. digitalhub/entities/project/builder.py +20 -51
  40. digitalhub/entities/project/crud.py +1 -1
  41. digitalhub/entities/run/_base/builder.py +73 -0
  42. digitalhub/entities/run/_base/entity.py +6 -149
  43. digitalhub/entities/run/builder.py +21 -47
  44. digitalhub/entities/run/crud.py +1 -1
  45. digitalhub/entities/secret/_base/builder.py +81 -0
  46. digitalhub/entities/secret/{secret → _base}/entity.py +2 -2
  47. digitalhub/entities/secret/builder.py +20 -62
  48. digitalhub/entities/secret/crud.py +2 -2
  49. digitalhub/entities/task/_base/builder.py +76 -0
  50. digitalhub/entities/task/builder.py +21 -44
  51. digitalhub/entities/task/crud.py +1 -1
  52. digitalhub/entities/workflow/_base/builder.py +78 -0
  53. digitalhub/entities/workflow/_base/entity.py +2 -2
  54. digitalhub/entities/workflow/builder.py +20 -60
  55. digitalhub/entities/workflow/crud.py +1 -1
  56. digitalhub/factory/factory.py +204 -0
  57. digitalhub/factory/utils.py +90 -0
  58. digitalhub/runtimes/builder.py +24 -41
  59. digitalhub/runtimes/kind_registry.py +14 -0
  60. digitalhub/runtimes/utils.py +28 -0
  61. digitalhub/utils/exceptions.py +6 -0
  62. digitalhub/utils/generic_utils.py +1 -1
  63. {digitalhub-0.8.0b3.dist-info → digitalhub-0.8.0b4.dist-info}/METADATA +1 -1
  64. {digitalhub-0.8.0b3.dist-info → digitalhub-0.8.0b4.dist-info}/RECORD +75 -57
  65. digitalhub/entities/_builders/factory.py +0 -44
  66. digitalhub/entities/registries.py +0 -48
  67. digitalhub/registry/models.py +0 -87
  68. digitalhub/registry/registry.py +0 -74
  69. digitalhub/registry/utils.py +0 -151
  70. /digitalhub/entities/project/{project → _base}/__init__.py +0 -0
  71. /digitalhub/entities/project/{project → _base}/spec.py +0 -0
  72. /digitalhub/entities/project/{project → _base}/status.py +0 -0
  73. /digitalhub/entities/secret/{secret → _base}/__init__.py +0 -0
  74. /digitalhub/entities/secret/{secret → _base}/spec.py +0 -0
  75. /digitalhub/entities/secret/{secret → _base}/status.py +0 -0
  76. /digitalhub/{registry → factory}/__init__.py +0 -0
  77. /digitalhub/runtimes/{base.py → _base.py} +0 -0
  78. {digitalhub-0.8.0b3.dist-info → digitalhub-0.8.0b4.dist-info}/LICENSE.txt +0 -0
  79. {digitalhub-0.8.0b3.dist-info → digitalhub-0.8.0b4.dist-info}/WHEEL +0 -0
  80. {digitalhub-0.8.0b3.dist-info → digitalhub-0.8.0b4.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,86 @@
1
+ from __future__ import annotations
2
+
3
+ import typing
4
+
5
+ from digitalhub.entities._base.versioned.builder import VersionedBuilder
6
+ from digitalhub.entities.utils.entity_types import EntityTypes
7
+ from digitalhub.utils.exceptions import EntityError
8
+
9
+ if typing.TYPE_CHECKING:
10
+ from digitalhub.entities.artifact._base.entity import Artifact
11
+
12
+
13
+ class ArtifactBuilder(VersionedBuilder):
14
+ """
15
+ Artifact builder.
16
+ """
17
+
18
+ ENTITY_TYPE = EntityTypes.ARTIFACT.value
19
+
20
+ def build(
21
+ self,
22
+ kind: str,
23
+ project: str,
24
+ name: str,
25
+ uuid: str | None = None,
26
+ description: str | None = None,
27
+ labels: list[str] | None = None,
28
+ embedded: bool = True,
29
+ path: str | None = None,
30
+ **kwargs,
31
+ ) -> Artifact:
32
+ """
33
+ Create a new object.
34
+
35
+ Parameters
36
+ ----------
37
+ project : str
38
+ Project name.
39
+ name : str
40
+ Object name.
41
+ kind : str
42
+ Kind the object.
43
+ uuid : str
44
+ ID of the object.
45
+ description : str
46
+ Description of the object (human readable).
47
+ labels : list[str]
48
+ List of labels.
49
+ embedded : bool
50
+ Flag to determine if object spec must be embedded in project spec.
51
+ path : str
52
+ Object path on local file system or remote storage. It is also the destination path of upload() method.
53
+ **kwargs : dict
54
+ Spec keyword arguments.
55
+
56
+ Returns
57
+ -------
58
+ Artifact
59
+ Object instance.
60
+ """
61
+ if path is None:
62
+ raise EntityError("Path must be provided.")
63
+
64
+ name = self.build_name(name)
65
+ uuid = self.build_uuid(uuid)
66
+ metadata = self.build_metadata(
67
+ project=project,
68
+ name=name,
69
+ description=description,
70
+ labels=labels,
71
+ embedded=embedded,
72
+ )
73
+ spec = self.build_spec(
74
+ path=path,
75
+ **kwargs,
76
+ )
77
+ status = self.build_status()
78
+ return self.build_entity(
79
+ project=project,
80
+ name=name,
81
+ uuid=uuid,
82
+ kind=kind,
83
+ metadata=metadata,
84
+ spec=spec,
85
+ status=status,
86
+ )
@@ -0,0 +1,18 @@
1
+ from __future__ import annotations
2
+
3
+ from digitalhub.entities.artifact._base.builder import ArtifactBuilder
4
+ from digitalhub.entities.artifact.artifact.entity import ArtifactArtifact
5
+ from digitalhub.entities.artifact.artifact.spec import ArtifactSpecArtifact, ArtifactValidatorArtifact
6
+ from digitalhub.entities.artifact.artifact.status import ArtifactStatusArtifact
7
+
8
+
9
+ class ArtifactArtifactBuilder(ArtifactBuilder):
10
+ """
11
+ ArtifactArtifact builder.
12
+ """
13
+
14
+ ENTITY_CLASS = ArtifactArtifact
15
+ ENTITY_SPEC_CLASS = ArtifactSpecArtifact
16
+ ENTITY_SPEC_VALIDATOR = ArtifactValidatorArtifact
17
+ ENTITY_STATUS_CLASS = ArtifactStatusArtifact
18
+ ENTITY_KIND = "artifact"
@@ -2,116 +2,32 @@ from __future__ import annotations
2
2
 
3
3
  import typing
4
4
 
5
- from digitalhub.entities._builders.metadata import build_metadata
6
- from digitalhub.entities._builders.name import build_name
7
- from digitalhub.entities._builders.spec import build_spec
8
- from digitalhub.entities._builders.status import build_status
9
- from digitalhub.entities._builders.uuid import build_uuid
10
- from digitalhub.utils.exceptions import EntityError
5
+ from digitalhub.factory.factory import factory
6
+ from digitalhub.utils.exceptions import BuilderError
11
7
 
12
8
  if typing.TYPE_CHECKING:
13
9
  from digitalhub.entities.artifact._base.entity import Artifact
14
10
 
15
- # Manage class mapper
16
- cls_mapper = {}
17
11
 
18
- try:
19
- from digitalhub.entities.artifact.artifact.entity import ArtifactArtifact
20
-
21
- cls_mapper["artifact"] = ArtifactArtifact
22
- except ImportError:
23
- pass
24
-
25
-
26
- def _choose_artifact_type(kind: str) -> type[Artifact]:
27
- """
28
- Choose class based on kind.
29
-
30
- Parameters
31
- ----------
32
- kind : str
33
- Kind the object.
34
-
35
- Returns
36
- -------
37
- type[Artifact]
38
- Class of the artifact.
39
- """
40
- try:
41
- return cls_mapper[kind]
42
- except KeyError:
43
- raise EntityError(f"Unknown artifact kind: {kind}")
44
-
45
-
46
- def artifact_from_parameters(
47
- project: str,
48
- name: str,
49
- kind: str,
50
- uuid: str | None = None,
51
- description: str | None = None,
52
- labels: list[str] | None = None,
53
- embedded: bool = True,
54
- path: str | None = None,
55
- **kwargs,
56
- ) -> Artifact:
12
+ def artifact_from_parameters(**kwargs) -> Artifact:
57
13
  """
58
14
  Create a new object.
59
15
 
60
16
  Parameters
61
17
  ----------
62
- project : str
63
- Project name.
64
- name : str
65
- Object name.
66
- kind : str
67
- Kind the object.
68
- uuid : str
69
- ID of the object (UUID4, e.g. 40f25c4b-d26b-4221-b048-9527aff291e2).
70
- description : str
71
- Description of the object (human readable).
72
- labels : list[str]
73
- List of labels.
74
- embedded : bool
75
- Flag to determine if object spec must be embedded in project spec.
76
- path : str
77
- Object path on local file system or remote storage. It is also the destination path of upload() method.
78
- **kwargs : dict
79
- Spec keyword arguments.
18
+ **kwargs
19
+ Keyword arguments.
80
20
 
81
21
  Returns
82
22
  -------
83
23
  Artifact
84
24
  Object instance.
85
25
  """
86
- if path is None:
87
- raise EntityError("Path must be provided.")
88
- name = build_name(name)
89
- uuid = build_uuid(uuid)
90
- metadata = build_metadata(
91
- kind,
92
- project=project,
93
- name=name,
94
- version=uuid,
95
- description=description,
96
- labels=labels,
97
- embedded=embedded,
98
- )
99
- spec = build_spec(
100
- kind,
101
- path=path,
102
- **kwargs,
103
- )
104
- status = build_status(kind)
105
- cls = _choose_artifact_type(kind)
106
- return cls(
107
- project=project,
108
- name=name,
109
- uuid=uuid,
110
- kind=kind,
111
- metadata=metadata,
112
- spec=spec,
113
- status=status,
114
- )
26
+ try:
27
+ kind = kwargs["kind"]
28
+ except KeyError:
29
+ raise BuilderError("Missing 'kind' parameter.")
30
+ return factory.build_entity_from_params(kind, **kwargs)
115
31
 
116
32
 
117
33
  def artifact_from_dict(obj: dict) -> Artifact:
@@ -128,6 +44,8 @@ def artifact_from_dict(obj: dict) -> Artifact:
128
44
  Artifact
129
45
  Object instance.
130
46
  """
131
- kind = obj.get("kind")
132
- cls = _choose_artifact_type(kind)
133
- return cls.from_dict(obj)
47
+ try:
48
+ kind = obj["kind"]
49
+ except KeyError:
50
+ raise BuilderError("Missing 'kind' parameter.")
51
+ return factory.build_entity_from_dict(kind, obj)
@@ -46,7 +46,7 @@ def new_artifact(
46
46
  kind : str
47
47
  Kind the object.
48
48
  uuid : str
49
- ID of the object (UUID4, e.g. 40f25c4b-d26b-4221-b048-9527aff291e2).
49
+ ID of the object.
50
50
  description : str
51
51
  Description of the object (human readable).
52
52
  labels : list[str]
@@ -0,0 +1,63 @@
1
+ from __future__ import annotations
2
+
3
+ from digitalhub.entities.artifact.artifact.builder import ArtifactArtifactBuilder
4
+ from digitalhub.entities.dataitem.dataitem.builder import DataitemDataitemBuilder
5
+ from digitalhub.entities.dataitem.table.builder import DataitemTableBuilder
6
+ from digitalhub.entities.model.mlflow.builder import ModelModelBuilder
7
+ from digitalhub.entities.project._base.builder import ProjectProjectBuilder
8
+ from digitalhub.entities.secret._base.builder import SecretSecretBuilder
9
+
10
+ entity_builders = (
11
+ (ProjectProjectBuilder.ENTITY_KIND, ProjectProjectBuilder),
12
+ (SecretSecretBuilder.ENTITY_KIND, SecretSecretBuilder),
13
+ (ArtifactArtifactBuilder.ENTITY_KIND, ArtifactArtifactBuilder),
14
+ (DataitemDataitemBuilder.ENTITY_KIND, DataitemDataitemBuilder),
15
+ (DataitemTableBuilder.ENTITY_KIND, DataitemTableBuilder),
16
+ (ModelModelBuilder.ENTITY_KIND, ModelModelBuilder),
17
+ )
18
+
19
+ ##############################
20
+ # Potential uninstalled entities
21
+ ##############################
22
+
23
+
24
+ try:
25
+ from digitalhub.entities.dataitem.iceberg.builder import DataitemIcebergBuilder
26
+
27
+ entity_builders = (
28
+ *entity_builders,
29
+ (DataitemIcebergBuilder.ENTITY_KIND, DataitemIcebergBuilder),
30
+ )
31
+ except ImportError:
32
+ ...
33
+
34
+
35
+ try:
36
+ from digitalhub.entities.model.model.builder import ModelMlflowBuilder
37
+
38
+ entity_builders = (
39
+ *entity_builders,
40
+ (ModelMlflowBuilder.ENTITY_KIND, ModelMlflowBuilder),
41
+ )
42
+ except ImportError:
43
+ ...
44
+
45
+ try:
46
+ from digitalhub.entities.model.sklearn.builder import ModelSklearnBuilder
47
+
48
+ entity_builders = (
49
+ *entity_builders,
50
+ (ModelSklearnBuilder.ENTITY_KIND, ModelSklearnBuilder),
51
+ )
52
+ except ImportError:
53
+ ...
54
+
55
+ try:
56
+ from digitalhub.entities.model.huggingface.builder import ModelHuggingfaceBuilder
57
+
58
+ entity_builders = (
59
+ *entity_builders,
60
+ (ModelHuggingfaceBuilder.ENTITY_KIND, ModelHuggingfaceBuilder),
61
+ )
62
+ except ImportError:
63
+ ...
@@ -0,0 +1,86 @@
1
+ from __future__ import annotations
2
+
3
+ import typing
4
+
5
+ from digitalhub.entities._base.versioned.builder import VersionedBuilder
6
+ from digitalhub.entities.utils.entity_types import EntityTypes
7
+ from digitalhub.utils.exceptions import EntityError
8
+
9
+ if typing.TYPE_CHECKING:
10
+ from digitalhub.entities.dataitem._base.entity import Dataitem
11
+
12
+
13
+ class DataitemBuilder(VersionedBuilder):
14
+ """
15
+ Dataitem builder.
16
+ """
17
+
18
+ ENTITY_TYPE = EntityTypes.DATAITEM.value
19
+
20
+ def build(
21
+ self,
22
+ kind: str,
23
+ project: str,
24
+ name: str,
25
+ uuid: str | None = None,
26
+ description: str | None = None,
27
+ labels: list[str] | None = None,
28
+ embedded: bool = True,
29
+ path: str | None = None,
30
+ **kwargs,
31
+ ) -> Dataitem:
32
+ """
33
+ Create a new object.
34
+
35
+ Parameters
36
+ ----------
37
+ project : str
38
+ Project name.
39
+ name : str
40
+ Object name.
41
+ kind : str
42
+ Kind the object.
43
+ uuid : str
44
+ ID of the object.
45
+ description : str
46
+ Description of the object (human readable).
47
+ labels : list[str]
48
+ List of labels.
49
+ embedded : bool
50
+ Flag to determine if object spec must be embedded in project spec.
51
+ path : str
52
+ Object path on local file system or remote storage. It is also the destination path of upload() method.
53
+ **kwargs : dict
54
+ Spec keyword arguments.
55
+
56
+ Returns
57
+ -------
58
+ Dataitem
59
+ Object instance.
60
+ """
61
+ if path is None:
62
+ raise EntityError("Path must be provided.")
63
+
64
+ name = self.build_name(name)
65
+ uuid = self.build_uuid(uuid)
66
+ metadata = self.build_metadata(
67
+ project=project,
68
+ name=name,
69
+ description=description,
70
+ labels=labels,
71
+ embedded=embedded,
72
+ )
73
+ spec = self.build_spec(
74
+ path=path,
75
+ **kwargs,
76
+ )
77
+ status = self.build_status()
78
+ return self.build_entity(
79
+ project=project,
80
+ name=name,
81
+ uuid=uuid,
82
+ kind=kind,
83
+ metadata=metadata,
84
+ spec=spec,
85
+ status=status,
86
+ )
@@ -2,127 +2,32 @@ from __future__ import annotations
2
2
 
3
3
  import typing
4
4
 
5
- from digitalhub.entities._builders.metadata import build_metadata
6
- from digitalhub.entities._builders.name import build_name
7
- from digitalhub.entities._builders.spec import build_spec
8
- from digitalhub.entities._builders.status import build_status
9
- from digitalhub.entities._builders.uuid import build_uuid
10
- from digitalhub.utils.exceptions import EntityError
5
+ from digitalhub.factory.factory import factory
6
+ from digitalhub.utils.exceptions import BuilderError
11
7
 
12
8
  if typing.TYPE_CHECKING:
13
9
  from digitalhub.entities.dataitem._base.entity import Dataitem
14
10
 
15
- # Manage class mapper
16
- cls_mapper = {}
17
- try:
18
- from digitalhub.entities.dataitem.dataitem.entity import DataitemDataitem
19
11
 
20
- cls_mapper["dataitem"] = DataitemDataitem
21
- except ImportError:
22
- ...
23
- try:
24
- from digitalhub.entities.dataitem.table.entity import DataitemTable
25
-
26
- cls_mapper["table"] = DataitemTable
27
- except ImportError:
28
- ...
29
- try:
30
- from digitalhub.entities.dataitem.iceberg.entity import DataitemIceberg
31
-
32
- cls_mapper["iceberg"] = DataitemIceberg
33
- except ImportError:
34
- pass
35
-
36
-
37
- def _choose_dataitem_type(kind: str) -> type[Dataitem]:
38
- """
39
- Choose class based on kind.
40
-
41
- Parameters
42
- ----------
43
- kind : str
44
- Kind the object.
45
-
46
- Returns
47
- -------
48
- type[Dataitem]
49
- Class of the dataitem.
50
- """
51
- try:
52
- return cls_mapper[kind]
53
- except KeyError:
54
- raise EntityError(f"Unknown dataitem kind: {kind}")
55
-
56
-
57
- def dataitem_from_parameters(
58
- project: str,
59
- name: str,
60
- kind: str,
61
- uuid: str | None = None,
62
- description: str | None = None,
63
- labels: list[str] | None = None,
64
- embedded: bool = True,
65
- path: str | None = None,
66
- **kwargs,
67
- ) -> Dataitem:
12
+ def dataitem_from_parameters(**kwargs) -> Dataitem:
68
13
  """
69
14
  Create a new object.
70
15
 
71
16
  Parameters
72
17
  ----------
73
- project : str
74
- Project name.
75
- name : str
76
- Object name.
77
- kind : str
78
- Kind the object.
79
- uuid : str
80
- ID of the object (UUID4, e.g. 40f25c4b-d26b-4221-b048-9527aff291e2).
81
- description : str
82
- Description of the object (human readable).
83
- labels : list[str]
84
- List of labels.
85
- embedded : bool
86
- Flag to determine if object spec must be embedded in project spec.
87
- path : str
88
- Object path on local file system or remote storage. It is also the destination path of upload() method.
89
- **kwargs : dict
90
- Spec keyword arguments.
18
+ **kwargs
19
+ Keyword arguments.
91
20
 
92
21
  Returns
93
22
  -------
94
23
  Dataitem
95
24
  Object instance.
96
25
  """
97
- if path is None:
98
- raise EntityError("Dataitem path must be provided")
99
- name = build_name(name)
100
- uuid = build_uuid(uuid)
101
- metadata = build_metadata(
102
- kind,
103
- project=project,
104
- name=name,
105
- version=uuid,
106
- description=description,
107
- labels=labels,
108
- embedded=embedded,
109
- )
110
- spec = build_spec(
111
- kind,
112
- path=path,
113
- **kwargs,
114
- )
115
- status = build_status(kind)
116
- cls = _choose_dataitem_type(kind)
117
- return cls(
118
- project=project,
119
- name=name,
120
- uuid=uuid,
121
- kind=kind,
122
- metadata=metadata,
123
- spec=spec,
124
- status=status,
125
- )
26
+ try:
27
+ kind = kwargs["kind"]
28
+ except KeyError:
29
+ raise BuilderError("Missing 'kind' parameter.")
30
+ return factory.build_entity_from_params(kind, **kwargs)
126
31
 
127
32
 
128
33
  def dataitem_from_dict(obj: dict) -> Dataitem:
@@ -139,6 +44,8 @@ def dataitem_from_dict(obj: dict) -> Dataitem:
139
44
  Dataitem
140
45
  Object instance.
141
46
  """
142
- kind = obj.get("kind")
143
- cls = _choose_dataitem_type(kind)
144
- return cls.from_dict(obj)
47
+ try:
48
+ kind = obj["kind"]
49
+ except KeyError:
50
+ raise BuilderError("Missing 'kind' parameter.")
51
+ return factory.build_entity_from_dict(kind, obj)
@@ -19,7 +19,7 @@ from digitalhub.entities.utils.utils import build_log_path_from_filename, build_
19
19
  from digitalhub.readers.builder import get_reader_by_object
20
20
  from digitalhub.stores.builder import get_store
21
21
  from digitalhub.utils.exceptions import EntityAlreadyExistsError
22
- from digitalhub.utils.generic_utils import sanitize_filename
22
+ from digitalhub.utils.generic_utils import slugify_string
23
23
  from digitalhub.utils.io_utils import read_yaml
24
24
 
25
25
  if typing.TYPE_CHECKING:
@@ -52,7 +52,7 @@ def new_dataitem(
52
52
  kind : str
53
53
  Kind the object.
54
54
  uuid : str
55
- ID of the object (UUID4, e.g. 40f25c4b-d26b-4221-b048-9527aff291e2).
55
+ ID of the object.
56
56
  description : str
57
57
  Description of the object (human readable).
58
58
  labels : list[str]
@@ -157,7 +157,7 @@ def log_dataitem(
157
157
  if path is None:
158
158
  uuid = build_uuid()
159
159
  kwargs["uuid"] = uuid
160
- slug = sanitize_filename(name) + f".{extension}"
160
+ slug = slugify_string(name) + f".{extension}"
161
161
  path = build_log_path_from_filename(project, ENTITY_TYPE, name, uuid, slug)
162
162
 
163
163
  obj = dataitem_from_parameters(project=project, name=name, kind=kind, path=path, **kwargs)
@@ -0,0 +1,18 @@
1
+ from __future__ import annotations
2
+
3
+ from digitalhub.entities.dataitem._base.builder import DataitemBuilder
4
+ from digitalhub.entities.dataitem.dataitem.entity import DataitemDataitem
5
+ from digitalhub.entities.dataitem.dataitem.spec import DataitemSpecDataitem, DataitemValidatorDataitem
6
+ from digitalhub.entities.dataitem.dataitem.status import DataitemStatusDataitem
7
+
8
+
9
+ class DataitemDataitemBuilder(DataitemBuilder):
10
+ """
11
+ DataitemDataitem builder.
12
+ """
13
+
14
+ ENTITY_CLASS = DataitemDataitem
15
+ ENTITY_SPEC_CLASS = DataitemSpecDataitem
16
+ ENTITY_SPEC_VALIDATOR = DataitemValidatorDataitem
17
+ ENTITY_STATUS_CLASS = DataitemStatusDataitem
18
+ ENTITY_KIND = "dataitem"
@@ -0,0 +1,18 @@
1
+ from __future__ import annotations
2
+
3
+ from digitalhub.entities.dataitem._base.builder import DataitemBuilder
4
+ from digitalhub.entities.dataitem.iceberg.entity import DataitemIceberg
5
+ from digitalhub.entities.dataitem.iceberg.spec import DataitemSpecIceberg, DataitemValidatorIceberg
6
+ from digitalhub.entities.dataitem.iceberg.status import DataitemStatusIceberg
7
+
8
+
9
+ class DataitemIcebergBuilder(DataitemBuilder):
10
+ """
11
+ DataitemIceberg builder.
12
+ """
13
+
14
+ ENTITY_CLASS = DataitemIceberg
15
+ ENTITY_SPEC_CLASS = DataitemSpecIceberg
16
+ ENTITY_SPEC_VALIDATOR = DataitemValidatorIceberg
17
+ ENTITY_STATUS_CLASS = DataitemStatusIceberg
18
+ ENTITY_KIND = "iceberg"
@@ -0,0 +1,18 @@
1
+ from __future__ import annotations
2
+
3
+ from digitalhub.entities.dataitem._base.builder import DataitemBuilder
4
+ from digitalhub.entities.dataitem.table.entity import DataitemTable
5
+ from digitalhub.entities.dataitem.table.spec import DataitemSpecTable, DataitemValidatorTable
6
+ from digitalhub.entities.dataitem.table.status import DataitemStatusTable
7
+
8
+
9
+ class DataitemTableBuilder(DataitemBuilder):
10
+ """
11
+ DataitemTable builder.
12
+ """
13
+
14
+ ENTITY_CLASS = DataitemTable
15
+ ENTITY_SPEC_CLASS = DataitemSpecTable
16
+ ENTITY_SPEC_VALIDATOR = DataitemValidatorTable
17
+ ENTITY_STATUS_CLASS = DataitemStatusTable
18
+ ENTITY_KIND = "table"