digitalhub 0.14.0b2__py3-none-any.whl → 0.14.0b3__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.
- digitalhub/context/builder.py +0 -4
- digitalhub/context/context.py +12 -8
- digitalhub/entities/_base/_base/entity.py +0 -4
- digitalhub/entities/_base/context/entity.py +1 -1
- digitalhub/entities/_base/entity/entity.py +0 -8
- digitalhub/entities/_base/executable/entity.py +5 -25
- digitalhub/entities/_base/material/entity.py +3 -23
- digitalhub/entities/_base/unversioned/entity.py +1 -1
- digitalhub/entities/_base/versioned/entity.py +1 -1
- digitalhub/entities/_processors/base/__init__.py +3 -0
- digitalhub/entities/_processors/{base.py → base/crud.py} +6 -226
- digitalhub/entities/_processors/base/import_export.py +122 -0
- digitalhub/entities/_processors/base/processor.py +302 -0
- digitalhub/entities/_processors/base/special_ops.py +108 -0
- digitalhub/entities/_processors/context/__init__.py +3 -0
- digitalhub/entities/_processors/context/crud.py +654 -0
- digitalhub/entities/_processors/context/import_export.py +242 -0
- digitalhub/entities/_processors/context/material.py +123 -0
- digitalhub/entities/_processors/context/processor.py +400 -0
- digitalhub/entities/_processors/context/special_ops.py +476 -0
- digitalhub/entities/_processors/processors.py +12 -0
- digitalhub/entities/artifact/crud.py +8 -24
- digitalhub/entities/dataitem/crud.py +8 -24
- digitalhub/entities/dataitem/table/entity.py +2 -6
- digitalhub/entities/function/crud.py +8 -24
- digitalhub/entities/model/_base/entity.py +3 -23
- digitalhub/entities/model/crud.py +8 -22
- digitalhub/entities/project/_base/entity.py +40 -129
- digitalhub/entities/project/crud.py +7 -22
- digitalhub/entities/run/_base/builder.py +0 -4
- digitalhub/entities/run/_base/entity.py +3 -59
- digitalhub/entities/run/crud.py +7 -19
- digitalhub/entities/secret/_base/entity.py +1 -5
- digitalhub/entities/secret/crud.py +8 -22
- digitalhub/entities/task/_base/builder.py +0 -4
- digitalhub/entities/task/_base/entity.py +1 -1
- digitalhub/entities/task/crud.py +7 -19
- digitalhub/entities/trigger/_base/entity.py +1 -5
- digitalhub/entities/trigger/crud.py +8 -24
- digitalhub/entities/workflow/crud.py +8 -24
- digitalhub/factory/registry.py +0 -24
- digitalhub/stores/client/dhcore/client.py +0 -18
- digitalhub/stores/client/dhcore/configurator.py +5 -28
- digitalhub/stores/client/dhcore/error_parser.py +0 -4
- digitalhub/stores/credentials/configurator.py +0 -24
- digitalhub/stores/credentials/handler.py +0 -12
- digitalhub/stores/credentials/store.py +0 -4
- digitalhub/stores/data/_base/store.py +0 -16
- digitalhub/stores/data/builder.py +0 -4
- digitalhub/stores/data/remote/store.py +0 -4
- digitalhub/stores/data/s3/configurator.py +0 -8
- digitalhub/stores/data/s3/store.py +0 -12
- digitalhub/stores/data/sql/configurator.py +0 -8
- digitalhub/stores/data/sql/store.py +0 -4
- digitalhub/stores/readers/data/factory.py +0 -8
- digitalhub/stores/readers/data/pandas/reader.py +0 -16
- digitalhub/utils/io_utils.py +0 -4
- {digitalhub-0.14.0b2.dist-info → digitalhub-0.14.0b3.dist-info}/METADATA +1 -1
- {digitalhub-0.14.0b2.dist-info → digitalhub-0.14.0b3.dist-info}/RECORD +62 -52
- digitalhub/entities/_processors/context.py +0 -1499
- {digitalhub-0.14.0b2.dist-info → digitalhub-0.14.0b3.dist-info}/WHEEL +0 -0
- {digitalhub-0.14.0b2.dist-info → digitalhub-0.14.0b3.dist-info}/licenses/AUTHORS +0 -0
- {digitalhub-0.14.0b2.dist-info → digitalhub-0.14.0b3.dist-info}/licenses/LICENSE +0 -0
|
@@ -7,7 +7,7 @@ from __future__ import annotations
|
|
|
7
7
|
import typing
|
|
8
8
|
|
|
9
9
|
from digitalhub.entities._commons.enums import EntityTypes
|
|
10
|
-
from digitalhub.entities._processors.
|
|
10
|
+
from digitalhub.entities._processors.processors import context_processor
|
|
11
11
|
|
|
12
12
|
if typing.TYPE_CHECKING:
|
|
13
13
|
from digitalhub.entities.workflow._base.entity import Workflow
|
|
@@ -99,9 +99,7 @@ def get_workflow(
|
|
|
99
99
|
Examples
|
|
100
100
|
--------
|
|
101
101
|
Using entity key:
|
|
102
|
-
>>> obj = get_workflow(
|
|
103
|
-
... "store://my-workflow-key"
|
|
104
|
-
... )
|
|
102
|
+
>>> obj = get_workflow("store://my-workflow-key")
|
|
105
103
|
|
|
106
104
|
Using entity name:
|
|
107
105
|
>>> obj = get_workflow("my-workflow-name"
|
|
@@ -142,9 +140,7 @@ def get_workflow_versions(
|
|
|
142
140
|
Examples
|
|
143
141
|
--------
|
|
144
142
|
Using entity key:
|
|
145
|
-
>>> obj = get_workflow_versions(
|
|
146
|
-
... "store://my-workflow-key"
|
|
147
|
-
... )
|
|
143
|
+
>>> obj = get_workflow_versions("store://my-workflow-key")
|
|
148
144
|
|
|
149
145
|
Using entity name:
|
|
150
146
|
>>> obj = get_workflow_versions("my-workflow-name"
|
|
@@ -176,9 +172,7 @@ def list_workflows(project: str, **kwargs) -> list[Workflow]:
|
|
|
176
172
|
|
|
177
173
|
Examples
|
|
178
174
|
--------
|
|
179
|
-
>>> objs = list_workflows(
|
|
180
|
-
... project="my-project"
|
|
181
|
-
... )
|
|
175
|
+
>>> objs = list_workflows(project="my-project")
|
|
182
176
|
"""
|
|
183
177
|
return context_processor.list_context_entities(
|
|
184
178
|
project=project,
|
|
@@ -214,9 +208,7 @@ def import_workflow(
|
|
|
214
208
|
|
|
215
209
|
Examples
|
|
216
210
|
--------
|
|
217
|
-
>>> obj = import_workflow(
|
|
218
|
-
... "my-workflow.yaml"
|
|
219
|
-
... )
|
|
211
|
+
>>> obj = import_workflow("my-workflow.yaml")
|
|
220
212
|
"""
|
|
221
213
|
return context_processor.import_executable_entity(file, key, reset_id, context)
|
|
222
214
|
|
|
@@ -237,9 +229,7 @@ def load_workflow(file: str) -> Workflow:
|
|
|
237
229
|
|
|
238
230
|
Examples
|
|
239
231
|
--------
|
|
240
|
-
>>> obj = load_workflow(
|
|
241
|
-
... "my-workflow.yaml"
|
|
242
|
-
... )
|
|
232
|
+
>>> obj = load_workflow("my-workflow.yaml")
|
|
243
233
|
"""
|
|
244
234
|
return context_processor.load_executable_entity(file)
|
|
245
235
|
|
|
@@ -260,11 +250,7 @@ def update_workflow(entity: Workflow) -> Workflow:
|
|
|
260
250
|
|
|
261
251
|
Examples
|
|
262
252
|
--------
|
|
263
|
-
>>> obj = (
|
|
264
|
-
... update_workflow(
|
|
265
|
-
... obj
|
|
266
|
-
... )
|
|
267
|
-
... )
|
|
253
|
+
>>> obj = update_workflow(obj)
|
|
268
254
|
"""
|
|
269
255
|
return context_processor.update_context_entity(
|
|
270
256
|
project=entity.project,
|
|
@@ -308,9 +294,7 @@ def delete_workflow(
|
|
|
308
294
|
Examples
|
|
309
295
|
--------
|
|
310
296
|
If delete_all_versions is False:
|
|
311
|
-
>>> obj = delete_workflow(
|
|
312
|
-
... "store://my-workflow-key"
|
|
313
|
-
... )
|
|
297
|
+
>>> obj = delete_workflow("store://my-workflow-key")
|
|
314
298
|
|
|
315
299
|
Otherwise:
|
|
316
300
|
>>> obj = delete_workflow("workflow-name",
|
digitalhub/factory/registry.py
CHANGED
|
@@ -47,10 +47,6 @@ class BuilderRegistry:
|
|
|
47
47
|
builder : type[EntityBuilder] | type[RuntimeEntityBuilder]
|
|
48
48
|
The builder class to register. It will be instantiated immediately.
|
|
49
49
|
|
|
50
|
-
Returns
|
|
51
|
-
-------
|
|
52
|
-
None
|
|
53
|
-
|
|
54
50
|
Raises
|
|
55
51
|
------
|
|
56
52
|
BuilderError
|
|
@@ -71,10 +67,6 @@ class BuilderRegistry:
|
|
|
71
67
|
builder : type[RuntimeBuilder]
|
|
72
68
|
The builder class to register. It will be instantiated immediately.
|
|
73
69
|
|
|
74
|
-
Returns
|
|
75
|
-
-------
|
|
76
|
-
None
|
|
77
|
-
|
|
78
70
|
Raises
|
|
79
71
|
------
|
|
80
72
|
BuilderError
|
|
@@ -141,10 +133,6 @@ class BuilderRegistry:
|
|
|
141
133
|
def _ensure_entities_registered(self) -> None:
|
|
142
134
|
"""
|
|
143
135
|
Ensure core entities are registered on-demand.
|
|
144
|
-
|
|
145
|
-
Returns
|
|
146
|
-
-------
|
|
147
|
-
None
|
|
148
136
|
"""
|
|
149
137
|
if self._entities_registered:
|
|
150
138
|
return
|
|
@@ -160,10 +148,6 @@ class BuilderRegistry:
|
|
|
160
148
|
|
|
161
149
|
Imports the core entities module and registers all entity
|
|
162
150
|
builders with the registry.
|
|
163
|
-
|
|
164
|
-
Returns
|
|
165
|
-
-------
|
|
166
|
-
None
|
|
167
151
|
"""
|
|
168
152
|
try:
|
|
169
153
|
module = import_module(FactoryEnum.REG_ENTITIES.value)
|
|
@@ -178,10 +162,6 @@ class BuilderRegistry:
|
|
|
178
162
|
def _ensure_runtimes_registered(self) -> None:
|
|
179
163
|
"""
|
|
180
164
|
Ensure runtime entities are registered on-demand.
|
|
181
|
-
|
|
182
|
-
Returns
|
|
183
|
-
-------
|
|
184
|
-
None
|
|
185
165
|
"""
|
|
186
166
|
if self._runtimes_registered:
|
|
187
167
|
return
|
|
@@ -197,10 +177,6 @@ class BuilderRegistry:
|
|
|
197
177
|
|
|
198
178
|
Imports each runtime package and registers its entity and runtime
|
|
199
179
|
builders with the registry.
|
|
200
|
-
|
|
201
|
-
Returns
|
|
202
|
-
-------
|
|
203
|
-
None
|
|
204
180
|
"""
|
|
205
181
|
try:
|
|
206
182
|
for package in list_runtimes():
|
|
@@ -58,16 +58,6 @@ class ClientDHCore(Client):
|
|
|
58
58
|
Parses backend responses and raises appropriate exceptions.
|
|
59
59
|
_configurator : ClientDHCoreConfigurator
|
|
60
60
|
Manages client configuration and authentication.
|
|
61
|
-
|
|
62
|
-
Examples
|
|
63
|
-
--------
|
|
64
|
-
>>> from digitalhub.stores.client.api import (
|
|
65
|
-
... get_client,
|
|
66
|
-
... )
|
|
67
|
-
>>> client = get_client(
|
|
68
|
-
... local=False
|
|
69
|
-
... )
|
|
70
|
-
>>> # Client is now ready for API operations
|
|
71
61
|
"""
|
|
72
62
|
|
|
73
63
|
def __init__(self, config: dict | None = None) -> None:
|
|
@@ -79,10 +69,6 @@ class ClientDHCore(Client):
|
|
|
79
69
|
config : dict, optional
|
|
80
70
|
DHCore environment configuration. If None, loads from environment
|
|
81
71
|
variables and configuration files.
|
|
82
|
-
|
|
83
|
-
Returns
|
|
84
|
-
-------
|
|
85
|
-
None
|
|
86
72
|
"""
|
|
87
73
|
super().__init__()
|
|
88
74
|
|
|
@@ -494,10 +480,6 @@ class ClientDHCore(Client):
|
|
|
494
480
|
response : Response
|
|
495
481
|
HTTP response containing X-Api-Level header.
|
|
496
482
|
|
|
497
|
-
Returns
|
|
498
|
-
-------
|
|
499
|
-
None
|
|
500
|
-
|
|
501
483
|
Raises
|
|
502
484
|
------
|
|
503
485
|
ClientError
|
|
@@ -47,10 +47,6 @@ class ClientDHCoreConfigurator(Configurator):
|
|
|
47
47
|
def __init__(self) -> None:
|
|
48
48
|
"""
|
|
49
49
|
Initialize DHCore configurator and evaluate authentication type.
|
|
50
|
-
|
|
51
|
-
Returns
|
|
52
|
-
-------
|
|
53
|
-
None
|
|
54
50
|
"""
|
|
55
51
|
super().__init__()
|
|
56
52
|
self._auth_type: str | None = None
|
|
@@ -66,10 +62,6 @@ class ClientDHCoreConfigurator(Configurator):
|
|
|
66
62
|
|
|
67
63
|
Sanitizes endpoint and issuer URLs to ensure proper HTTP/HTTPS schemes
|
|
68
64
|
and removes trailing slashes.
|
|
69
|
-
|
|
70
|
-
Returns
|
|
71
|
-
-------
|
|
72
|
-
None
|
|
73
65
|
"""
|
|
74
66
|
env_creds = self._creds_handler.load_from_env(self.keys)
|
|
75
67
|
env_creds = self._sanitize_env_vars(env_creds)
|
|
@@ -107,10 +99,6 @@ class ClientDHCoreConfigurator(Configurator):
|
|
|
107
99
|
|
|
108
100
|
Handles keys without "DHCORE_" prefix for CLI compatibility. Falls back
|
|
109
101
|
to environment variables for missing endpoint and personal access token values.
|
|
110
|
-
|
|
111
|
-
Returns
|
|
112
|
-
-------
|
|
113
|
-
None
|
|
114
102
|
"""
|
|
115
103
|
file_creds = self._creds_handler.load_from_file(self.keys)
|
|
116
104
|
|
|
@@ -119,6 +107,11 @@ class ClientDHCoreConfigurator(Configurator):
|
|
|
119
107
|
if file_creds[pat] is None:
|
|
120
108
|
file_creds[pat] = self._creds_handler.load_from_env([pat]).get(pat)
|
|
121
109
|
|
|
110
|
+
# Because in the response there is no endpoint
|
|
111
|
+
endpoint = CredsEnvVar.DHCORE_ENDPOINT.value
|
|
112
|
+
if file_creds[endpoint] is None:
|
|
113
|
+
file_creds[endpoint] = self._creds_handler.load_from_env([endpoint]).get(endpoint)
|
|
114
|
+
|
|
122
115
|
file_creds = self._sanitize_file_vars(file_creds)
|
|
123
116
|
self._creds_handler.set_credentials(self._file, file_creds)
|
|
124
117
|
|
|
@@ -208,10 +201,6 @@ class ClientDHCoreConfigurator(Configurator):
|
|
|
208
201
|
|
|
209
202
|
Changes between environment and file credential sources, then re-evaluates
|
|
210
203
|
authentication type based on the new credentials.
|
|
211
|
-
|
|
212
|
-
Returns
|
|
213
|
-
-------
|
|
214
|
-
None
|
|
215
204
|
"""
|
|
216
205
|
super().change_origin()
|
|
217
206
|
|
|
@@ -230,10 +219,6 @@ class ClientDHCoreConfigurator(Configurator):
|
|
|
230
219
|
OAUTH2 (access + refresh tokens), ACCESS_TOKEN (access only), BASIC
|
|
231
220
|
(username + password). For EXCHANGE type, automatically exchanges the
|
|
232
221
|
personal access token and switches to file-based credentials storage.
|
|
233
|
-
|
|
234
|
-
Returns
|
|
235
|
-
-------
|
|
236
|
-
None
|
|
237
222
|
"""
|
|
238
223
|
creds = creds_handler.get_credentials(self._origin)
|
|
239
224
|
self._auth_type = self._eval_auth_type(creds)
|
|
@@ -305,10 +290,6 @@ class ClientDHCoreConfigurator(Configurator):
|
|
|
305
290
|
change_origin : bool, default False
|
|
306
291
|
Whether to switch credential sources on auth failure.
|
|
307
292
|
|
|
308
|
-
Returns
|
|
309
|
-
-------
|
|
310
|
-
None
|
|
311
|
-
|
|
312
293
|
Raises
|
|
313
294
|
------
|
|
314
295
|
ClientError
|
|
@@ -462,10 +443,6 @@ class ClientDHCoreConfigurator(Configurator):
|
|
|
462
443
|
----------
|
|
463
444
|
response : dict
|
|
464
445
|
OAuth2 token response with new credentials.
|
|
465
|
-
|
|
466
|
-
Returns
|
|
467
|
-
-------
|
|
468
|
-
None
|
|
469
446
|
"""
|
|
470
447
|
for key in self.keys_to_prefix:
|
|
471
448
|
key = key.lower()
|
|
@@ -53,10 +53,6 @@ class Configurator:
|
|
|
53
53
|
def load_configs(self) -> None:
|
|
54
54
|
"""
|
|
55
55
|
Load the configuration from both environment and file sources.
|
|
56
|
-
|
|
57
|
-
Returns
|
|
58
|
-
-------
|
|
59
|
-
None
|
|
60
56
|
"""
|
|
61
57
|
self.load_env_vars()
|
|
62
58
|
self.load_file_vars()
|
|
@@ -71,10 +67,6 @@ class Configurator:
|
|
|
71
67
|
"""
|
|
72
68
|
Check if the current profile has changed and reload
|
|
73
69
|
the file credentials if needed.
|
|
74
|
-
|
|
75
|
-
Returns
|
|
76
|
-
-------
|
|
77
|
-
None
|
|
78
70
|
"""
|
|
79
71
|
if (current := self._creds_handler.get_current_profile()) != self._current_profile:
|
|
80
72
|
self.load_file_vars()
|
|
@@ -119,10 +111,6 @@ class Configurator:
|
|
|
119
111
|
"""
|
|
120
112
|
Attempt to change the origin of credentials.
|
|
121
113
|
Raise error if already evaluated.
|
|
122
|
-
|
|
123
|
-
Returns
|
|
124
|
-
-------
|
|
125
|
-
None
|
|
126
114
|
"""
|
|
127
115
|
try:
|
|
128
116
|
self.change_origin()
|
|
@@ -132,10 +120,6 @@ class Configurator:
|
|
|
132
120
|
def change_origin(self) -> None:
|
|
133
121
|
"""
|
|
134
122
|
Change the origin of credentials from env to file or vice versa.
|
|
135
|
-
|
|
136
|
-
Returns
|
|
137
|
-
-------
|
|
138
|
-
None
|
|
139
123
|
"""
|
|
140
124
|
if self._changed_origin:
|
|
141
125
|
raise ConfigError("Origin has already been changed.")
|
|
@@ -147,10 +131,6 @@ class Configurator:
|
|
|
147
131
|
def change_to_file(self) -> None:
|
|
148
132
|
"""
|
|
149
133
|
Set the credentials origin to file.
|
|
150
|
-
|
|
151
|
-
Returns
|
|
152
|
-
-------
|
|
153
|
-
None
|
|
154
134
|
"""
|
|
155
135
|
if self._origin == self._env:
|
|
156
136
|
self._changed_origin = True
|
|
@@ -159,10 +139,6 @@ class Configurator:
|
|
|
159
139
|
def change_to_env(self) -> None:
|
|
160
140
|
"""
|
|
161
141
|
Set the credentials origin to environment.
|
|
162
|
-
|
|
163
|
-
Returns
|
|
164
|
-
-------
|
|
165
|
-
None
|
|
166
142
|
"""
|
|
167
143
|
if self._origin == self._file:
|
|
168
144
|
self._changed_origin = True
|
|
@@ -64,10 +64,6 @@ class CredentialHandler:
|
|
|
64
64
|
----------
|
|
65
65
|
creds_set : str
|
|
66
66
|
Name of the credentials profile to set.
|
|
67
|
-
|
|
68
|
-
Returns
|
|
69
|
-
-------
|
|
70
|
-
None
|
|
71
67
|
"""
|
|
72
68
|
self._profile = creds_set
|
|
73
69
|
set_current_profile(creds_set)
|
|
@@ -127,10 +123,6 @@ class CredentialHandler:
|
|
|
127
123
|
----------
|
|
128
124
|
creds : dict
|
|
129
125
|
Credentials to write.
|
|
130
|
-
|
|
131
|
-
Returns
|
|
132
|
-
-------
|
|
133
|
-
None
|
|
134
126
|
"""
|
|
135
127
|
write_config(creds, self._profile)
|
|
136
128
|
|
|
@@ -148,10 +140,6 @@ class CredentialHandler:
|
|
|
148
140
|
The origin of the credentials ('env' or 'file').
|
|
149
141
|
creds : dict
|
|
150
142
|
Credentials to set.
|
|
151
|
-
|
|
152
|
-
Returns
|
|
153
|
-
-------
|
|
154
|
-
None
|
|
155
143
|
"""
|
|
156
144
|
self._creds_store.set_credentials(self._profile, origin, creds)
|
|
157
145
|
|
|
@@ -42,10 +42,6 @@ class CredentialsStore:
|
|
|
42
42
|
Origin of the credentials ('env' or 'file').
|
|
43
43
|
credentials : dict of str to Any
|
|
44
44
|
Dictionary of credentials to set.
|
|
45
|
-
|
|
46
|
-
Returns
|
|
47
|
-
-------
|
|
48
|
-
None
|
|
49
45
|
"""
|
|
50
46
|
if origin == CredsOrigin.ENV.value:
|
|
51
47
|
for key, value in credentials.items():
|
|
@@ -114,10 +114,6 @@ class Store:
|
|
|
114
114
|
src : str
|
|
115
115
|
The source path.
|
|
116
116
|
|
|
117
|
-
Returns
|
|
118
|
-
-------
|
|
119
|
-
None
|
|
120
|
-
|
|
121
117
|
Raises
|
|
122
118
|
------
|
|
123
119
|
StoreError
|
|
@@ -135,10 +131,6 @@ class Store:
|
|
|
135
131
|
dst : str
|
|
136
132
|
The destination path.
|
|
137
133
|
|
|
138
|
-
Returns
|
|
139
|
-
-------
|
|
140
|
-
None
|
|
141
|
-
|
|
142
134
|
Raises
|
|
143
135
|
------
|
|
144
136
|
StoreError
|
|
@@ -158,10 +150,6 @@ class Store:
|
|
|
158
150
|
overwrite : bool
|
|
159
151
|
Specify if overwrite an existing file.
|
|
160
152
|
|
|
161
|
-
Returns
|
|
162
|
-
-------
|
|
163
|
-
None
|
|
164
|
-
|
|
165
153
|
Raises
|
|
166
154
|
------
|
|
167
155
|
StoreError
|
|
@@ -179,10 +167,6 @@ class Store:
|
|
|
179
167
|
----------
|
|
180
168
|
path : str | Path
|
|
181
169
|
The path to build.
|
|
182
|
-
|
|
183
|
-
Returns
|
|
184
|
-
-------
|
|
185
|
-
None
|
|
186
170
|
"""
|
|
187
171
|
if not isinstance(path, Path):
|
|
188
172
|
path = Path(path)
|
|
@@ -46,10 +46,6 @@ class S3StoreConfigurator(Configurator):
|
|
|
46
46
|
def load_env_vars(self) -> None:
|
|
47
47
|
"""
|
|
48
48
|
Loads the credentials from the environment variables.
|
|
49
|
-
|
|
50
|
-
Returns
|
|
51
|
-
-------
|
|
52
|
-
None
|
|
53
49
|
"""
|
|
54
50
|
env_creds = self._creds_handler.load_from_env(self.keys)
|
|
55
51
|
self._creds_handler.set_credentials(self._env, env_creds)
|
|
@@ -57,10 +53,6 @@ class S3StoreConfigurator(Configurator):
|
|
|
57
53
|
def load_file_vars(self) -> None:
|
|
58
54
|
"""
|
|
59
55
|
Loads the credentials from a file.
|
|
60
|
-
|
|
61
|
-
Returns
|
|
62
|
-
-------
|
|
63
|
-
None
|
|
64
56
|
"""
|
|
65
57
|
file_creds = self._creds_handler.load_from_file(self.keys)
|
|
66
58
|
self._creds_handler.set_credentials(self._file, file_creds)
|
|
@@ -350,10 +350,6 @@ class S3Store(Store):
|
|
|
350
350
|
S3 path of the object to be downloaded (e.g., 's3://bucket
|
|
351
351
|
filename : Path
|
|
352
352
|
Local path where the downloaded object will be saved.
|
|
353
|
-
|
|
354
|
-
Returns
|
|
355
|
-
-------
|
|
356
|
-
None
|
|
357
353
|
"""
|
|
358
354
|
client, bucket = self._check_factory(src)
|
|
359
355
|
key = self._get_key(src)
|
|
@@ -575,10 +571,6 @@ class S3Store(Store):
|
|
|
575
571
|
The S3 client object.
|
|
576
572
|
bucket : str
|
|
577
573
|
The name of the S3 bucket.
|
|
578
|
-
|
|
579
|
-
Returns
|
|
580
|
-
-------
|
|
581
|
-
None
|
|
582
574
|
"""
|
|
583
575
|
extra_args = {}
|
|
584
576
|
mime_type = get_file_mime_type(src)
|
|
@@ -612,10 +604,6 @@ class S3Store(Store):
|
|
|
612
604
|
The S3 client object.
|
|
613
605
|
bucket : str
|
|
614
606
|
The name of the S3 bucket.
|
|
615
|
-
|
|
616
|
-
Returns
|
|
617
|
-
-------
|
|
618
|
-
None
|
|
619
607
|
"""
|
|
620
608
|
client.upload_fileobj(
|
|
621
609
|
Fileobj=fileobj,
|
|
@@ -56,10 +56,6 @@ class SqlStoreConfigurator(Configurator):
|
|
|
56
56
|
Retrieves SQL database connection credentials from the system
|
|
57
57
|
environment variables and stores them in the configurator's
|
|
58
58
|
credential handler for use in database connections.
|
|
59
|
-
|
|
60
|
-
Returns
|
|
61
|
-
-------
|
|
62
|
-
None
|
|
63
59
|
"""
|
|
64
60
|
env_creds = self._creds_handler.load_from_env(self.keys)
|
|
65
61
|
self._creds_handler.set_credentials(self._env, env_creds)
|
|
@@ -71,10 +67,6 @@ class SqlStoreConfigurator(Configurator):
|
|
|
71
67
|
Retrieves SQL database connection credentials from a
|
|
72
68
|
configuration file and stores them in the configurator's
|
|
73
69
|
credential handler for use in database connections.
|
|
74
|
-
|
|
75
|
-
Returns
|
|
76
|
-
-------
|
|
77
|
-
None
|
|
78
70
|
"""
|
|
79
71
|
file_creds = self._creds_handler.load_from_file(self.keys)
|
|
80
72
|
self._creds_handler.set_credentials(self._file, file_creds)
|
|
@@ -33,10 +33,6 @@ class ReaderFactory:
|
|
|
33
33
|
Reader name.
|
|
34
34
|
builder : DataframeReader
|
|
35
35
|
Builder object.
|
|
36
|
-
|
|
37
|
-
Returns
|
|
38
|
-
-------
|
|
39
|
-
None
|
|
40
36
|
"""
|
|
41
37
|
if self._engine_builders is None:
|
|
42
38
|
self._engine_builders = {}
|
|
@@ -104,10 +100,6 @@ class ReaderFactory:
|
|
|
104
100
|
----------
|
|
105
101
|
engine : str
|
|
106
102
|
Engine name.
|
|
107
|
-
|
|
108
|
-
Returns
|
|
109
|
-
-------
|
|
110
|
-
None
|
|
111
103
|
"""
|
|
112
104
|
if engine not in self._engine_builders:
|
|
113
105
|
raise BuilderError(f"Engine {engine} not found.")
|
|
@@ -104,10 +104,6 @@ class DataframeReaderPandas(DataframeReader):
|
|
|
104
104
|
The destination of the dataframe.
|
|
105
105
|
**kwargs : dict
|
|
106
106
|
Keyword arguments.
|
|
107
|
-
|
|
108
|
-
Returns
|
|
109
|
-
-------
|
|
110
|
-
None
|
|
111
107
|
"""
|
|
112
108
|
if extension == FileExtensions.CSV.value:
|
|
113
109
|
return self.write_csv(df, dst, **kwargs)
|
|
@@ -128,10 +124,6 @@ class DataframeReaderPandas(DataframeReader):
|
|
|
128
124
|
The destination of the dataframe.
|
|
129
125
|
**kwargs : dict
|
|
130
126
|
Keyword arguments.
|
|
131
|
-
|
|
132
|
-
Returns
|
|
133
|
-
-------
|
|
134
|
-
None
|
|
135
127
|
"""
|
|
136
128
|
if "index" not in kwargs:
|
|
137
129
|
kwargs["index"] = False
|
|
@@ -150,10 +142,6 @@ class DataframeReaderPandas(DataframeReader):
|
|
|
150
142
|
The destination of the dataframe.
|
|
151
143
|
**kwargs : dict
|
|
152
144
|
Keyword arguments.
|
|
153
|
-
|
|
154
|
-
Returns
|
|
155
|
-
-------
|
|
156
|
-
None
|
|
157
145
|
"""
|
|
158
146
|
if "index" not in kwargs:
|
|
159
147
|
kwargs["index"] = False
|
|
@@ -176,10 +164,6 @@ class DataframeReaderPandas(DataframeReader):
|
|
|
176
164
|
The destination schema.
|
|
177
165
|
**kwargs : dict
|
|
178
166
|
Keyword arguments.
|
|
179
|
-
|
|
180
|
-
Returns
|
|
181
|
-
-------
|
|
182
|
-
None
|
|
183
167
|
"""
|
|
184
168
|
if "index" not in kwargs:
|
|
185
169
|
kwargs["index"] = False
|
digitalhub/utils/io_utils.py
CHANGED
|
@@ -80,10 +80,6 @@ class NoDatesSafeLoader(yaml.SafeLoader):
|
|
|
80
80
|
----------
|
|
81
81
|
tag_to_remove : str
|
|
82
82
|
The tag to remove.
|
|
83
|
-
|
|
84
|
-
Returns
|
|
85
|
-
-------
|
|
86
|
-
None
|
|
87
83
|
"""
|
|
88
84
|
if "yaml_implicit_resolvers" not in cls.__dict__:
|
|
89
85
|
cls.yaml_implicit_resolvers = cls.yaml_implicit_resolvers.copy()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: digitalhub
|
|
3
|
-
Version: 0.14.
|
|
3
|
+
Version: 0.14.0b3
|
|
4
4
|
Summary: Python SDK for Digitalhub
|
|
5
5
|
Project-URL: Homepage, https://github.com/scc-digitalhub/digitalhub-sdk
|
|
6
6
|
Author-email: Fondazione Bruno Kessler <digitalhub@fbk.eu>, Matteo Martini <mmartini@fbk.eu>
|