dc-python-sdk 1.5.12__tar.gz → 1.5.14__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dc_python_sdk-1.5.12/src/dc_python_sdk.egg-info → dc_python_sdk-1.5.14}/PKG-INFO +1 -1
- {dc_python_sdk-1.5.12 → dc_python_sdk-1.5.14}/pyproject.toml +1 -1
- {dc_python_sdk-1.5.12 → dc_python_sdk-1.5.14}/setup.cfg +1 -1
- {dc_python_sdk-1.5.12 → dc_python_sdk-1.5.14/src/dc_python_sdk.egg-info}/PKG-INFO +1 -1
- {dc_python_sdk-1.5.12 → dc_python_sdk-1.5.14}/src/dc_sdk/app.py +2 -0
- {dc_python_sdk-1.5.12 → dc_python_sdk-1.5.14}/src/dc_sdk/cli.py +3 -0
- {dc_python_sdk-1.5.12 → dc_python_sdk-1.5.14}/src/dc_sdk/errors.py +54 -2
- {dc_python_sdk-1.5.12 → dc_python_sdk-1.5.14}/src/dc_sdk/handler.py +2 -0
- {dc_python_sdk-1.5.12 → dc_python_sdk-1.5.14}/src/dc_sdk/src/server.py +3 -2
- {dc_python_sdk-1.5.12 → dc_python_sdk-1.5.14}/LICENSE +0 -0
- {dc_python_sdk-1.5.12 → dc_python_sdk-1.5.14}/README.md +0 -0
- {dc_python_sdk-1.5.12 → dc_python_sdk-1.5.14}/src/dc_python_sdk.egg-info/SOURCES.txt +0 -0
- {dc_python_sdk-1.5.12 → dc_python_sdk-1.5.14}/src/dc_python_sdk.egg-info/dependency_links.txt +0 -0
- {dc_python_sdk-1.5.12 → dc_python_sdk-1.5.14}/src/dc_python_sdk.egg-info/entry_points.txt +0 -0
- {dc_python_sdk-1.5.12 → dc_python_sdk-1.5.14}/src/dc_python_sdk.egg-info/requires.txt +0 -0
- {dc_python_sdk-1.5.12 → dc_python_sdk-1.5.14}/src/dc_python_sdk.egg-info/top_level.txt +0 -0
- {dc_python_sdk-1.5.12 → dc_python_sdk-1.5.14}/src/dc_sdk/__init__.py +0 -0
- {dc_python_sdk-1.5.12 → dc_python_sdk-1.5.14}/src/dc_sdk/src/__init__.py +0 -0
- {dc_python_sdk-1.5.12 → dc_python_sdk-1.5.14}/src/dc_sdk/src/mapping.py +0 -0
- {dc_python_sdk-1.5.12 → dc_python_sdk-1.5.14}/src/dc_sdk/src/models/__init__.py +0 -0
- {dc_python_sdk-1.5.12 → dc_python_sdk-1.5.14}/src/dc_sdk/src/models/enums.py +0 -0
- {dc_python_sdk-1.5.12 → dc_python_sdk-1.5.14}/src/dc_sdk/src/models/errors.py +0 -0
- {dc_python_sdk-1.5.12 → dc_python_sdk-1.5.14}/src/dc_sdk/src/models/log_templates.py +0 -0
- {dc_python_sdk-1.5.12 → dc_python_sdk-1.5.14}/src/dc_sdk/src/models/pipeline_details.py +0 -0
- {dc_python_sdk-1.5.12 → dc_python_sdk-1.5.14}/src/dc_sdk/src/pipeline.py +0 -0
- {dc_python_sdk-1.5.12 → dc_python_sdk-1.5.14}/src/dc_sdk/src/services/__init__.py +0 -0
- {dc_python_sdk-1.5.12 → dc_python_sdk-1.5.14}/src/dc_sdk/src/services/api.py +0 -0
- {dc_python_sdk-1.5.12 → dc_python_sdk-1.5.14}/src/dc_sdk/src/services/aws.py +0 -0
- {dc_python_sdk-1.5.12 → dc_python_sdk-1.5.14}/src/dc_sdk/src/services/environment.py +0 -0
- {dc_python_sdk-1.5.12 → dc_python_sdk-1.5.14}/src/dc_sdk/src/services/loader.py +0 -0
- {dc_python_sdk-1.5.12 → dc_python_sdk-1.5.14}/src/dc_sdk/src/services/logger.py +0 -0
- {dc_python_sdk-1.5.12 → dc_python_sdk-1.5.14}/src/dc_sdk/src/services/session.py +0 -0
- {dc_python_sdk-1.5.12 → dc_python_sdk-1.5.14}/src/dc_sdk/types.py +0 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from importlib.metadata import version
|
|
1
2
|
from dc_sdk.src.services.environment import PipelineEnvironment
|
|
2
3
|
|
|
3
4
|
PipelineEnvironment.validate_environment()
|
|
@@ -19,6 +20,7 @@ is_source = TasksEnum.SOURCE.value == TASK
|
|
|
19
20
|
print("Initialized Connector task: ", TASK)
|
|
20
21
|
|
|
21
22
|
def run_pipeline():
|
|
23
|
+
print("version: ", version("dc-python-sdk"))
|
|
22
24
|
try:
|
|
23
25
|
if PipelineEnvironment.pipeline_run_history_id is None:
|
|
24
26
|
pipeline_run_history_id = api.create_new_history(PipelineEnvironment.pipeline_id)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import sys
|
|
2
|
+
from importlib.metadata import version
|
|
2
3
|
|
|
3
4
|
def main():
|
|
4
5
|
if len(sys.argv) < 2:
|
|
@@ -7,6 +8,8 @@ def main():
|
|
|
7
8
|
|
|
8
9
|
command = sys.argv[1]
|
|
9
10
|
|
|
11
|
+
print("version: ", version("dc-python-sdk"))
|
|
12
|
+
|
|
10
13
|
print(f"[DC SDK] Command: {command}")
|
|
11
14
|
|
|
12
15
|
if command == "http":
|
|
@@ -11,6 +11,17 @@ class Error(Exception):
|
|
|
11
11
|
def __str__(self):
|
|
12
12
|
return self.error_name + self.message
|
|
13
13
|
|
|
14
|
+
def to_dict(self):
|
|
15
|
+
return {
|
|
16
|
+
"error": self.message,
|
|
17
|
+
"error_class": self.__class__.__name__,
|
|
18
|
+
"internal_error": self.internal,
|
|
19
|
+
"args": {
|
|
20
|
+
k: v for k, v in self.__dict__.items()
|
|
21
|
+
if k not in ["error_name", "internal"]
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
14
25
|
|
|
15
26
|
class AuthenticationError(Error):
|
|
16
27
|
error_name = "Authentication Error - "
|
|
@@ -24,6 +35,7 @@ class AuthenticationError(Error):
|
|
|
24
35
|
|
|
25
36
|
:param message: An error message - WILL BE VISIBLE TO CLIENT
|
|
26
37
|
"""
|
|
38
|
+
super().__init__(message, self.error_name, self.internal)
|
|
27
39
|
self.message = message
|
|
28
40
|
self.error_name = "Authentication Error - "
|
|
29
41
|
self.internal = False
|
|
@@ -36,8 +48,8 @@ class WhitelistError(Error):
|
|
|
36
48
|
internal = False
|
|
37
49
|
|
|
38
50
|
def __init__(self, message=None):
|
|
51
|
+
super().__init__(message, self.error_name, self.internal)
|
|
39
52
|
self.message = message
|
|
40
|
-
self.error_name = "Whitelist Error - "
|
|
41
53
|
self.internal = False
|
|
42
54
|
|
|
43
55
|
|
|
@@ -47,6 +59,7 @@ class NoObjectsFoundError(Error):
|
|
|
47
59
|
internal = False
|
|
48
60
|
|
|
49
61
|
def __init__(self, message=None):
|
|
62
|
+
super().__init__(message, self.error_name, self.internal)
|
|
50
63
|
self.message = message
|
|
51
64
|
self.error_name = "No Objects Found Error - "
|
|
52
65
|
self.internal = False
|
|
@@ -59,6 +72,7 @@ class GetObjectsError(Error):
|
|
|
59
72
|
internal = False
|
|
60
73
|
|
|
61
74
|
def __init__(self, message=None):
|
|
75
|
+
super().__init__(message, self.error_name, self.internal)
|
|
62
76
|
self.message = message
|
|
63
77
|
self.error_name = "Get Objects Error - "
|
|
64
78
|
self.internal = False
|
|
@@ -70,6 +84,7 @@ class NoFieldsFoundError(Error):
|
|
|
70
84
|
internal = False
|
|
71
85
|
|
|
72
86
|
def __init__(self, object_id, message=None):
|
|
87
|
+
super().__init__(message, self.error_name, self.internal)
|
|
73
88
|
self.object_id = object_id
|
|
74
89
|
self.message = message
|
|
75
90
|
self.error_name = "No Fields Found Error - "
|
|
@@ -90,6 +105,7 @@ class GetFieldsError(Error):
|
|
|
90
105
|
internal = False
|
|
91
106
|
|
|
92
107
|
def __init__(self, object_id, message=None):
|
|
108
|
+
super().__init__(message, self.error_name, self.internal)
|
|
93
109
|
self.object_id = object_id
|
|
94
110
|
self.message = message
|
|
95
111
|
self.error_name = "Get Fields Error - "
|
|
@@ -109,6 +125,7 @@ class BadFieldIDError(Error):
|
|
|
109
125
|
internal = True
|
|
110
126
|
|
|
111
127
|
def __init__(self, field_id=None, object_id=None, message=None):
|
|
128
|
+
super().__init__(message, self.error_name, self.internal)
|
|
112
129
|
self.field_id = field_id
|
|
113
130
|
self.object_id = object_id
|
|
114
131
|
self.message = message
|
|
@@ -130,6 +147,7 @@ class FilterDataTypeError(Error):
|
|
|
130
147
|
internal = True
|
|
131
148
|
|
|
132
149
|
def __init__(self, datatype=None, field_to_filter=None, message=None):
|
|
150
|
+
super().__init__(message, self.error_name, self.internal)
|
|
133
151
|
self.datatype = datatype
|
|
134
152
|
self.field = field_to_filter
|
|
135
153
|
self.message = message
|
|
@@ -150,6 +168,7 @@ class BadObjectIDError(Error):
|
|
|
150
168
|
internal = True
|
|
151
169
|
|
|
152
170
|
def __init__(self, object_id=None, message=None):
|
|
171
|
+
super().__init__(message, self.error_name, self.internal)
|
|
153
172
|
self.object_id = object_id
|
|
154
173
|
self.message = message
|
|
155
174
|
self.error_name = "Bad Object ID Error - "
|
|
@@ -169,6 +188,7 @@ class UpdateMethodNotSupportedError(Error):
|
|
|
169
188
|
internal = True
|
|
170
189
|
|
|
171
190
|
def __init__(self, update_method=None, connector=None, message=None):
|
|
191
|
+
super().__init__(message, self.error_name, self.internal)
|
|
172
192
|
self.update_method = update_method
|
|
173
193
|
self.connector = connector
|
|
174
194
|
self.message = message
|
|
@@ -189,6 +209,7 @@ class MappingError(Error):
|
|
|
189
209
|
internal = True
|
|
190
210
|
|
|
191
211
|
def __init__(self, message):
|
|
212
|
+
super().__init__(message, self.error_name, self.internal)
|
|
192
213
|
self.message = message
|
|
193
214
|
self.error_name = "Mapping Error - "
|
|
194
215
|
self.internal = False
|
|
@@ -200,6 +221,7 @@ class DataError(Error):
|
|
|
200
221
|
internal = True
|
|
201
222
|
|
|
202
223
|
def __init__(self, message):
|
|
224
|
+
super().__init__(message, self.error_name, self.internal)
|
|
203
225
|
self.message = message
|
|
204
226
|
self.error_name = "Data Error - "
|
|
205
227
|
self.internal = False
|
|
@@ -211,6 +233,7 @@ class APIRequestError(Error):
|
|
|
211
233
|
internal = True
|
|
212
234
|
|
|
213
235
|
def __init__(self, error_code_returned=None, message=None):
|
|
236
|
+
super().__init__(message, self.error_name, self.internal)
|
|
214
237
|
self.error_code = error_code_returned
|
|
215
238
|
self.message = message
|
|
216
239
|
self.error_name = "API Request Error - "
|
|
@@ -229,6 +252,7 @@ class APITimeoutError(Error):
|
|
|
229
252
|
internal = True
|
|
230
253
|
|
|
231
254
|
def __init__(self, message=None):
|
|
255
|
+
super().__init__(message, self.error_name, self.internal)
|
|
232
256
|
self.message = message
|
|
233
257
|
self.error_name = "API Timeout Error - "
|
|
234
258
|
self.internal = False
|
|
@@ -240,6 +264,7 @@ class FieldDataTypeError(Error):
|
|
|
240
264
|
internal = True
|
|
241
265
|
|
|
242
266
|
def __init__(self, datatype=None, field=None, message=None):
|
|
267
|
+
super().__init__(message, self.error_name, self.internal)
|
|
243
268
|
self.datatype = datatype
|
|
244
269
|
self.field = field
|
|
245
270
|
self.message = message
|
|
@@ -260,6 +285,7 @@ class APIPermissionError(Error):
|
|
|
260
285
|
internal = True
|
|
261
286
|
|
|
262
287
|
def __init__(self, message=None):
|
|
288
|
+
super().__init__(message, self.error_name, self.internal)
|
|
263
289
|
self.message = message
|
|
264
290
|
self.error_name = "API Permission Error - "
|
|
265
291
|
self.internal = False
|
|
@@ -270,7 +296,8 @@ class LoadDataError(Error):
|
|
|
270
296
|
error_name = "Load Data Error - "
|
|
271
297
|
internal = True
|
|
272
298
|
|
|
273
|
-
def __init__(self, message=None):
|
|
299
|
+
def __init__(self, message=None):
|
|
300
|
+
super().__init__(message, self.error_name, self.internal)
|
|
274
301
|
self.message = message
|
|
275
302
|
self.error_name = "Load Data Error - "
|
|
276
303
|
self.internal = False
|
|
@@ -282,6 +309,7 @@ class NotADestinationError(Error):
|
|
|
282
309
|
internal = True
|
|
283
310
|
|
|
284
311
|
def __init__(self, message=None):
|
|
312
|
+
super().__init__(message, self.error_name, self.internal)
|
|
285
313
|
self.message = message
|
|
286
314
|
self.error_name = "Not A Destination Error - "
|
|
287
315
|
self.internal = True
|
|
@@ -294,6 +322,7 @@ class NotImplementedError(Error):
|
|
|
294
322
|
internal = True
|
|
295
323
|
|
|
296
324
|
def __init__(self, message=None):
|
|
325
|
+
super().__init__(message, self.error_name, self.internal)
|
|
297
326
|
self.message = message
|
|
298
327
|
self.error_name = "Not Implemented Error - "
|
|
299
328
|
self.internal = True
|
|
@@ -305,6 +334,7 @@ class NoRowsFoundError(Error):
|
|
|
305
334
|
internal = True
|
|
306
335
|
|
|
307
336
|
def __init__(self, message=None):
|
|
337
|
+
super().__init__(message, self.error_name, self.internal)
|
|
308
338
|
self.message = message
|
|
309
339
|
self.error_name = "No Rows Found Error - "
|
|
310
340
|
self.internal = True
|
|
@@ -322,3 +352,25 @@ def external_errors():
|
|
|
322
352
|
error_list.append(error.__name__)
|
|
323
353
|
return error_list
|
|
324
354
|
|
|
355
|
+
ERROR_MAPPING = {
|
|
356
|
+
"AuthenticationError": AuthenticationError,
|
|
357
|
+
"WhitelistError": WhitelistError,
|
|
358
|
+
"NoObjectsFoundError": NoObjectsFoundError,
|
|
359
|
+
"GetObjectsError": GetObjectsError,
|
|
360
|
+
"NoFieldsFoundError": NoFieldsFoundError,
|
|
361
|
+
"GetFieldsError": GetFieldsError,
|
|
362
|
+
"BadFieldIDError": BadFieldIDError,
|
|
363
|
+
"FilterDataTypeError": FilterDataTypeError,
|
|
364
|
+
"BadObjectIDError": BadObjectIDError,
|
|
365
|
+
"UpdateMethodNotSupportedError": UpdateMethodNotSupportedError,
|
|
366
|
+
"MappingError": MappingError,
|
|
367
|
+
"DataError": DataError,
|
|
368
|
+
"APIRequestError": APIRequestError,
|
|
369
|
+
"APITimeoutError": APITimeoutError,
|
|
370
|
+
"FieldDataTypeError": FieldDataTypeError,
|
|
371
|
+
"APIPermissionError": APIPermissionError,
|
|
372
|
+
"LoadDataError": LoadDataError,
|
|
373
|
+
"NotADestinationError": NotADestinationError,
|
|
374
|
+
"NotImplementedError": NotImplementedError,
|
|
375
|
+
"NoRowsFoundError": NoRowsFoundError,
|
|
376
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from dc_sdk.errors import Error
|
|
2
2
|
from dc_sdk.src.mapping import Mapping
|
|
3
3
|
import traceback
|
|
4
|
+
from importlib.metadata import version
|
|
4
5
|
|
|
5
6
|
def get_action_name(action: int) -> str:
|
|
6
7
|
return {
|
|
@@ -12,6 +13,7 @@ def get_action_name(action: int) -> str:
|
|
|
12
13
|
}[action]
|
|
13
14
|
|
|
14
15
|
def handler(event, context):
|
|
16
|
+
print("version: ", version("dc-python-sdk"))
|
|
15
17
|
"""Lambda Handler"""
|
|
16
18
|
action_name = None
|
|
17
19
|
internal_error = False
|
|
@@ -26,6 +26,7 @@ def invoke(req: InvokeRequest):
|
|
|
26
26
|
result = None
|
|
27
27
|
message = None
|
|
28
28
|
error = None
|
|
29
|
+
error_dict = {}
|
|
29
30
|
internal_error = False
|
|
30
31
|
session_id = req.session_id
|
|
31
32
|
|
|
@@ -67,6 +68,7 @@ def invoke(req: InvokeRequest):
|
|
|
67
68
|
message = e.message
|
|
68
69
|
internal_error = e.internal
|
|
69
70
|
error = traceback.format_exc()
|
|
71
|
+
error_dict = e.to_dict()
|
|
70
72
|
|
|
71
73
|
except Exception:
|
|
72
74
|
error = traceback.format_exc()
|
|
@@ -79,8 +81,7 @@ def invoke(req: InvokeRequest):
|
|
|
79
81
|
"message": message if not internal_error else "Something went wrong",
|
|
80
82
|
"results": result,
|
|
81
83
|
"session_id": session_id,
|
|
82
|
-
|
|
83
|
-
"internal_error": internal_error
|
|
84
|
+
**error_dict
|
|
84
85
|
}
|
|
85
86
|
|
|
86
87
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dc_python_sdk-1.5.12 → dc_python_sdk-1.5.14}/src/dc_python_sdk.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|