dc-python-sdk 1.5.51__tar.gz → 1.5.54__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.51/src/dc_python_sdk.egg-info → dc_python_sdk-1.5.54}/PKG-INFO +17 -2
- {dc_python_sdk-1.5.51 → dc_python_sdk-1.5.54}/README.md +13 -1
- {dc_python_sdk-1.5.51 → dc_python_sdk-1.5.54}/pyproject.toml +7 -2
- {dc_python_sdk-1.5.51 → dc_python_sdk-1.5.54}/setup.cfg +1 -1
- {dc_python_sdk-1.5.51 → dc_python_sdk-1.5.54/src/dc_python_sdk.egg-info}/PKG-INFO +17 -2
- {dc_python_sdk-1.5.51 → dc_python_sdk-1.5.54}/src/dc_python_sdk.egg-info/SOURCES.txt +2 -0
- {dc_python_sdk-1.5.51 → dc_python_sdk-1.5.54}/src/dc_python_sdk.egg-info/requires.txt +4 -0
- {dc_python_sdk-1.5.51 → dc_python_sdk-1.5.54}/src/dc_sdk/errors.py +57 -1
- dc_python_sdk-1.5.54/src/dc_sdk/file_utils.py +1454 -0
- {dc_python_sdk-1.5.51 → dc_python_sdk-1.5.54}/src/dc_sdk/handler.py +3 -2
- dc_python_sdk-1.5.54/src/dc_sdk/json_safe.py +55 -0
- {dc_python_sdk-1.5.51 → dc_python_sdk-1.5.54}/src/dc_sdk/src/ai.py +4 -0
- {dc_python_sdk-1.5.51 → dc_python_sdk-1.5.54}/src/dc_sdk/src/ai_http.py +4 -0
- {dc_python_sdk-1.5.51 → dc_python_sdk-1.5.54}/src/dc_sdk/src/models/errors.py +49 -1
- {dc_python_sdk-1.5.51 → dc_python_sdk-1.5.54}/src/dc_sdk/src/pipeline.py +3 -2
- {dc_python_sdk-1.5.51 → dc_python_sdk-1.5.54}/src/dc_sdk/src/server.py +1 -1
- {dc_python_sdk-1.5.51 → dc_python_sdk-1.5.54}/LICENSE +0 -0
- {dc_python_sdk-1.5.51 → dc_python_sdk-1.5.54}/src/dc_python_sdk.egg-info/dependency_links.txt +0 -0
- {dc_python_sdk-1.5.51 → dc_python_sdk-1.5.54}/src/dc_python_sdk.egg-info/entry_points.txt +0 -0
- {dc_python_sdk-1.5.51 → dc_python_sdk-1.5.54}/src/dc_python_sdk.egg-info/top_level.txt +0 -0
- {dc_python_sdk-1.5.51 → dc_python_sdk-1.5.54}/src/dc_sdk/__init__.py +0 -0
- {dc_python_sdk-1.5.51 → dc_python_sdk-1.5.54}/src/dc_sdk/app.py +0 -0
- {dc_python_sdk-1.5.51 → dc_python_sdk-1.5.54}/src/dc_sdk/cli.py +0 -0
- {dc_python_sdk-1.5.51 → dc_python_sdk-1.5.54}/src/dc_sdk/data_stream.py +0 -0
- {dc_python_sdk-1.5.51 → dc_python_sdk-1.5.54}/src/dc_sdk/src/__init__.py +0 -0
- {dc_python_sdk-1.5.51 → dc_python_sdk-1.5.54}/src/dc_sdk/src/connection_status.py +0 -0
- {dc_python_sdk-1.5.51 → dc_python_sdk-1.5.54}/src/dc_sdk/src/destination_object_template.py +0 -0
- {dc_python_sdk-1.5.51 → dc_python_sdk-1.5.54}/src/dc_sdk/src/mapping.py +0 -0
- {dc_python_sdk-1.5.51 → dc_python_sdk-1.5.54}/src/dc_sdk/src/models/__init__.py +0 -0
- {dc_python_sdk-1.5.51 → dc_python_sdk-1.5.54}/src/dc_sdk/src/models/enums.py +0 -0
- {dc_python_sdk-1.5.51 → dc_python_sdk-1.5.54}/src/dc_sdk/src/models/log_templates.py +0 -0
- {dc_python_sdk-1.5.51 → dc_python_sdk-1.5.54}/src/dc_sdk/src/models/pipeline_details.py +0 -0
- {dc_python_sdk-1.5.51 → dc_python_sdk-1.5.54}/src/dc_sdk/src/services/__init__.py +0 -0
- {dc_python_sdk-1.5.51 → dc_python_sdk-1.5.54}/src/dc_sdk/src/services/api.py +0 -0
- {dc_python_sdk-1.5.51 → dc_python_sdk-1.5.54}/src/dc_sdk/src/services/aws.py +0 -0
- {dc_python_sdk-1.5.51 → dc_python_sdk-1.5.54}/src/dc_sdk/src/services/environment.py +0 -0
- {dc_python_sdk-1.5.51 → dc_python_sdk-1.5.54}/src/dc_sdk/src/services/loader.py +0 -0
- {dc_python_sdk-1.5.51 → dc_python_sdk-1.5.54}/src/dc_sdk/src/services/logger.py +0 -0
- {dc_python_sdk-1.5.51 → dc_python_sdk-1.5.54}/src/dc_sdk/src/services/session.py +0 -0
- {dc_python_sdk-1.5.51 → dc_python_sdk-1.5.54}/src/dc_sdk/types.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dc-python-sdk
|
|
3
|
-
Version: 1.5.
|
|
3
|
+
Version: 1.5.54
|
|
4
4
|
Summary: Data Connector Python SDK
|
|
5
5
|
Home-page: https://github.com/data-connector/dc-python-sdk
|
|
6
6
|
Author: DataConnector
|
|
@@ -26,6 +26,9 @@ Requires-Dist: numpy>=1.21.6; extra == "test"
|
|
|
26
26
|
Requires-Dist: pandas>=1.3.5; extra == "test"
|
|
27
27
|
Provides-Extra: ai
|
|
28
28
|
Requires-Dist: openai; extra == "ai"
|
|
29
|
+
Provides-Extra: file
|
|
30
|
+
Requires-Dist: numpy>=1.21.6; extra == "file"
|
|
31
|
+
Requires-Dist: pandas>=1.3.5; extra == "file"
|
|
29
32
|
Dynamic: license-file
|
|
30
33
|
|
|
31
34
|
# Data Connector Python SDK
|
|
@@ -139,7 +142,7 @@ Our system uses the `dc_sdk` library to gracefully throw errors. This ensures:
|
|
|
139
142
|
|
|
140
143
|
## Error Categories
|
|
141
144
|
|
|
142
|
-
The SDK provides
|
|
145
|
+
The SDK provides 25 different error classes organized into logical categories. Each error is designed to handle specific failure scenarios:
|
|
143
146
|
|
|
144
147
|
### Authentication Errors
|
|
145
148
|
- `AuthenticationError` - Invalid credentials, expired tokens
|
|
@@ -152,6 +155,8 @@ The SDK provides 21 different error classes organized into logical categories. E
|
|
|
152
155
|
- `GetFieldsError` - Cannot retrieve field information
|
|
153
156
|
- `BadFieldIDError` - Invalid field ID for object
|
|
154
157
|
- `BadObjectIDError` - Object ID doesn't exist
|
|
158
|
+
- `FieldNotFoundError` - Requested fields are missing from a file or object
|
|
159
|
+
- `ObjectNotFoundError` - File or object could not be found at the source
|
|
155
160
|
|
|
156
161
|
### Data Filtering & Mapping Errors
|
|
157
162
|
- `FilterDataTypeError` - Invalid data type for filtering
|
|
@@ -160,6 +165,7 @@ The SDK provides 21 different error classes organized into logical categories. E
|
|
|
160
165
|
|
|
161
166
|
### Data Retrieval Errors
|
|
162
167
|
- `DataError` - Generic data retrieval failure
|
|
168
|
+
- `InvalidFileFormatError` - File could not be parsed or has no usable format
|
|
163
169
|
- `APIRequestError` - API returned error status
|
|
164
170
|
- `APITimeoutError` - Request timeout
|
|
165
171
|
- `APIPermissionError` - Insufficient API permissions
|
|
@@ -172,6 +178,15 @@ The SDK provides 21 different error classes organized into logical categories. E
|
|
|
172
178
|
|
|
173
179
|
### Implementation Errors
|
|
174
180
|
- `NotImplementedError` - Required method not implemented
|
|
181
|
+
- `FileUtilsDependencyError` - Connector imported `dc_sdk.file_utils` without installing pandas/numpy
|
|
182
|
+
|
|
183
|
+
File connectors can share parsing helpers with:
|
|
184
|
+
|
|
185
|
+
```python
|
|
186
|
+
from dc_sdk.file_utils import FileConnectorUtilis
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
That import is optional. Connectors that use it must also install pandas and numpy (for example `pip install pandas numpy`). Other connectors should keep importing `from dc_sdk import errors` only, so they never load pandas.
|
|
175
190
|
|
|
176
191
|
For detailed examples and usage patterns, see the [Examples](#examples) section below.
|
|
177
192
|
|
|
@@ -109,7 +109,7 @@ Our system uses the `dc_sdk` library to gracefully throw errors. This ensures:
|
|
|
109
109
|
|
|
110
110
|
## Error Categories
|
|
111
111
|
|
|
112
|
-
The SDK provides
|
|
112
|
+
The SDK provides 25 different error classes organized into logical categories. Each error is designed to handle specific failure scenarios:
|
|
113
113
|
|
|
114
114
|
### Authentication Errors
|
|
115
115
|
- `AuthenticationError` - Invalid credentials, expired tokens
|
|
@@ -122,6 +122,8 @@ The SDK provides 21 different error classes organized into logical categories. E
|
|
|
122
122
|
- `GetFieldsError` - Cannot retrieve field information
|
|
123
123
|
- `BadFieldIDError` - Invalid field ID for object
|
|
124
124
|
- `BadObjectIDError` - Object ID doesn't exist
|
|
125
|
+
- `FieldNotFoundError` - Requested fields are missing from a file or object
|
|
126
|
+
- `ObjectNotFoundError` - File or object could not be found at the source
|
|
125
127
|
|
|
126
128
|
### Data Filtering & Mapping Errors
|
|
127
129
|
- `FilterDataTypeError` - Invalid data type for filtering
|
|
@@ -130,6 +132,7 @@ The SDK provides 21 different error classes organized into logical categories. E
|
|
|
130
132
|
|
|
131
133
|
### Data Retrieval Errors
|
|
132
134
|
- `DataError` - Generic data retrieval failure
|
|
135
|
+
- `InvalidFileFormatError` - File could not be parsed or has no usable format
|
|
133
136
|
- `APIRequestError` - API returned error status
|
|
134
137
|
- `APITimeoutError` - Request timeout
|
|
135
138
|
- `APIPermissionError` - Insufficient API permissions
|
|
@@ -142,6 +145,15 @@ The SDK provides 21 different error classes organized into logical categories. E
|
|
|
142
145
|
|
|
143
146
|
### Implementation Errors
|
|
144
147
|
- `NotImplementedError` - Required method not implemented
|
|
148
|
+
- `FileUtilsDependencyError` - Connector imported `dc_sdk.file_utils` without installing pandas/numpy
|
|
149
|
+
|
|
150
|
+
File connectors can share parsing helpers with:
|
|
151
|
+
|
|
152
|
+
```python
|
|
153
|
+
from dc_sdk.file_utils import FileConnectorUtilis
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
That import is optional. Connectors that use it must also install pandas and numpy (for example `pip install pandas numpy`). Other connectors should keep importing `from dc_sdk import errors` only, so they never load pandas.
|
|
145
157
|
|
|
146
158
|
For detailed examples and usage patterns, see the [Examples](#examples) section below.
|
|
147
159
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "dc-python-sdk"
|
|
7
|
-
version = "1.5.
|
|
7
|
+
version = "1.5.54"
|
|
8
8
|
description = "Data Connector Python SDK"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.6"
|
|
@@ -38,6 +38,11 @@ ai = [
|
|
|
38
38
|
"openai",
|
|
39
39
|
]
|
|
40
40
|
|
|
41
|
+
file = [
|
|
42
|
+
"numpy>=1.21.6",
|
|
43
|
+
"pandas>=1.3.5",
|
|
44
|
+
]
|
|
45
|
+
|
|
41
46
|
[project.urls]
|
|
42
47
|
"Bug Tracker" = "https://github.com/data-connector/dc-python-sdk/issues"
|
|
43
48
|
|
|
@@ -49,4 +54,4 @@ where = ["src"]
|
|
|
49
54
|
|
|
50
55
|
[tool.pytest.ini_options]
|
|
51
56
|
pythonpath = ["src", "tests"]
|
|
52
|
-
testpaths = ["tests"]
|
|
57
|
+
testpaths = ["tests"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dc-python-sdk
|
|
3
|
-
Version: 1.5.
|
|
3
|
+
Version: 1.5.54
|
|
4
4
|
Summary: Data Connector Python SDK
|
|
5
5
|
Home-page: https://github.com/data-connector/dc-python-sdk
|
|
6
6
|
Author: DataConnector
|
|
@@ -26,6 +26,9 @@ Requires-Dist: numpy>=1.21.6; extra == "test"
|
|
|
26
26
|
Requires-Dist: pandas>=1.3.5; extra == "test"
|
|
27
27
|
Provides-Extra: ai
|
|
28
28
|
Requires-Dist: openai; extra == "ai"
|
|
29
|
+
Provides-Extra: file
|
|
30
|
+
Requires-Dist: numpy>=1.21.6; extra == "file"
|
|
31
|
+
Requires-Dist: pandas>=1.3.5; extra == "file"
|
|
29
32
|
Dynamic: license-file
|
|
30
33
|
|
|
31
34
|
# Data Connector Python SDK
|
|
@@ -139,7 +142,7 @@ Our system uses the `dc_sdk` library to gracefully throw errors. This ensures:
|
|
|
139
142
|
|
|
140
143
|
## Error Categories
|
|
141
144
|
|
|
142
|
-
The SDK provides
|
|
145
|
+
The SDK provides 25 different error classes organized into logical categories. Each error is designed to handle specific failure scenarios:
|
|
143
146
|
|
|
144
147
|
### Authentication Errors
|
|
145
148
|
- `AuthenticationError` - Invalid credentials, expired tokens
|
|
@@ -152,6 +155,8 @@ The SDK provides 21 different error classes organized into logical categories. E
|
|
|
152
155
|
- `GetFieldsError` - Cannot retrieve field information
|
|
153
156
|
- `BadFieldIDError` - Invalid field ID for object
|
|
154
157
|
- `BadObjectIDError` - Object ID doesn't exist
|
|
158
|
+
- `FieldNotFoundError` - Requested fields are missing from a file or object
|
|
159
|
+
- `ObjectNotFoundError` - File or object could not be found at the source
|
|
155
160
|
|
|
156
161
|
### Data Filtering & Mapping Errors
|
|
157
162
|
- `FilterDataTypeError` - Invalid data type for filtering
|
|
@@ -160,6 +165,7 @@ The SDK provides 21 different error classes organized into logical categories. E
|
|
|
160
165
|
|
|
161
166
|
### Data Retrieval Errors
|
|
162
167
|
- `DataError` - Generic data retrieval failure
|
|
168
|
+
- `InvalidFileFormatError` - File could not be parsed or has no usable format
|
|
163
169
|
- `APIRequestError` - API returned error status
|
|
164
170
|
- `APITimeoutError` - Request timeout
|
|
165
171
|
- `APIPermissionError` - Insufficient API permissions
|
|
@@ -172,6 +178,15 @@ The SDK provides 21 different error classes organized into logical categories. E
|
|
|
172
178
|
|
|
173
179
|
### Implementation Errors
|
|
174
180
|
- `NotImplementedError` - Required method not implemented
|
|
181
|
+
- `FileUtilsDependencyError` - Connector imported `dc_sdk.file_utils` without installing pandas/numpy
|
|
182
|
+
|
|
183
|
+
File connectors can share parsing helpers with:
|
|
184
|
+
|
|
185
|
+
```python
|
|
186
|
+
from dc_sdk.file_utils import FileConnectorUtilis
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
That import is optional. Connectors that use it must also install pandas and numpy (for example `pip install pandas numpy`). Other connectors should keep importing `from dc_sdk import errors` only, so they never load pandas.
|
|
175
190
|
|
|
176
191
|
For detailed examples and usage patterns, see the [Examples](#examples) section below.
|
|
177
192
|
|
|
@@ -9,7 +9,9 @@ class Error(Exception):
|
|
|
9
9
|
self.internal = internal
|
|
10
10
|
|
|
11
11
|
def __str__(self):
|
|
12
|
-
|
|
12
|
+
name = self.error_name if self.error_name is not None else type(self).__name__
|
|
13
|
+
msg = self.message if self.message is not None else ""
|
|
14
|
+
return f"{name}{msg}"
|
|
13
15
|
|
|
14
16
|
def to_dict(self):
|
|
15
17
|
return {
|
|
@@ -35,6 +37,8 @@ class AuthenticationError(Error):
|
|
|
35
37
|
|
|
36
38
|
:param message: An error message - WILL BE VISIBLE TO CLIENT
|
|
37
39
|
"""
|
|
40
|
+
if not message:
|
|
41
|
+
message = "Authentication failed."
|
|
38
42
|
super().__init__(message, self.error_name, self.internal)
|
|
39
43
|
self.message = message
|
|
40
44
|
self.error_name = "Authentication Error - "
|
|
@@ -340,6 +344,54 @@ class NoRowsFoundError(Error):
|
|
|
340
344
|
self.internal = True
|
|
341
345
|
|
|
342
346
|
|
|
347
|
+
class InvalidFileFormatError(Error):
|
|
348
|
+
"""Raised when a file object cannot be parsed or has no usable format."""
|
|
349
|
+
error_name = "Invalid File Format Error - "
|
|
350
|
+
internal = False
|
|
351
|
+
|
|
352
|
+
def __init__(self, message=None):
|
|
353
|
+
super().__init__(message, self.error_name, self.internal)
|
|
354
|
+
self.message = message
|
|
355
|
+
self.error_name = "Invalid File Format Error - "
|
|
356
|
+
self.internal = False
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
class FieldNotFoundError(Error):
|
|
360
|
+
"""Raised when requested fields are not present in a file or object."""
|
|
361
|
+
error_name = "Field Not Found Error - "
|
|
362
|
+
internal = False
|
|
363
|
+
|
|
364
|
+
def __init__(self, message=None):
|
|
365
|
+
super().__init__(message, self.error_name, self.internal)
|
|
366
|
+
self.message = message
|
|
367
|
+
self.error_name = "Field Not Found Error - "
|
|
368
|
+
self.internal = False
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
class ObjectNotFoundError(Error):
|
|
372
|
+
"""Raised when a file or object id cannot be found at the source."""
|
|
373
|
+
error_name = "Object Not Found Error - "
|
|
374
|
+
internal = False
|
|
375
|
+
|
|
376
|
+
def __init__(self, message=None):
|
|
377
|
+
super().__init__(message, self.error_name, self.internal)
|
|
378
|
+
self.message = message
|
|
379
|
+
self.error_name = "Object Not Found Error - "
|
|
380
|
+
self.internal = False
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
class FileUtilsDependencyError(Error):
|
|
384
|
+
"""Raised when a connector imports file utils without pandas/numpy installed."""
|
|
385
|
+
error_name = "File Utils Dependency Error - "
|
|
386
|
+
internal = False
|
|
387
|
+
|
|
388
|
+
def __init__(self, message=None):
|
|
389
|
+
super().__init__(message, self.error_name, self.internal)
|
|
390
|
+
self.message = message
|
|
391
|
+
self.error_name = "File Utils Dependency Error - "
|
|
392
|
+
self.internal = False
|
|
393
|
+
|
|
394
|
+
|
|
343
395
|
def external_errors():
|
|
344
396
|
error_list = []
|
|
345
397
|
classes = [cls[1] for cls in inspect.getmembers(sys.modules[__name__],
|
|
@@ -373,4 +425,8 @@ ERROR_MAPPING = {
|
|
|
373
425
|
"NotADestinationError": NotADestinationError,
|
|
374
426
|
"NotImplementedError": NotImplementedError,
|
|
375
427
|
"NoRowsFoundError": NoRowsFoundError,
|
|
428
|
+
"InvalidFileFormatError": InvalidFileFormatError,
|
|
429
|
+
"FieldNotFoundError": FieldNotFoundError,
|
|
430
|
+
"ObjectNotFoundError": ObjectNotFoundError,
|
|
431
|
+
"FileUtilsDependencyError": FileUtilsDependencyError,
|
|
376
432
|
}
|