dc-python-sdk 1.5.48__tar.gz → 1.5.49__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.48/src/dc_python_sdk.egg-info → dc_python_sdk-1.5.49}/PKG-INFO +1 -1
- {dc_python_sdk-1.5.48 → dc_python_sdk-1.5.49}/pyproject.toml +1 -1
- {dc_python_sdk-1.5.48 → dc_python_sdk-1.5.49}/setup.cfg +1 -1
- {dc_python_sdk-1.5.48 → dc_python_sdk-1.5.49/src/dc_python_sdk.egg-info}/PKG-INFO +1 -1
- {dc_python_sdk-1.5.48 → dc_python_sdk-1.5.49}/src/dc_python_sdk.egg-info/SOURCES.txt +1 -0
- {dc_python_sdk-1.5.48 → dc_python_sdk-1.5.49}/src/dc_sdk/cli.py +0 -2
- {dc_python_sdk-1.5.48 → dc_python_sdk-1.5.49}/src/dc_sdk/handler.py +34 -3
- dc_python_sdk-1.5.49/src/dc_sdk/src/connection_status.py +34 -0
- dc_python_sdk-1.5.49/src/dc_sdk/src/mapping.py +191 -0
- dc_python_sdk-1.5.48/src/dc_sdk/src/mapping.py +0 -109
- {dc_python_sdk-1.5.48 → dc_python_sdk-1.5.49}/LICENSE +0 -0
- {dc_python_sdk-1.5.48 → dc_python_sdk-1.5.49}/README.md +0 -0
- {dc_python_sdk-1.5.48 → dc_python_sdk-1.5.49}/src/dc_python_sdk.egg-info/dependency_links.txt +0 -0
- {dc_python_sdk-1.5.48 → dc_python_sdk-1.5.49}/src/dc_python_sdk.egg-info/entry_points.txt +0 -0
- {dc_python_sdk-1.5.48 → dc_python_sdk-1.5.49}/src/dc_python_sdk.egg-info/requires.txt +0 -0
- {dc_python_sdk-1.5.48 → dc_python_sdk-1.5.49}/src/dc_python_sdk.egg-info/top_level.txt +0 -0
- {dc_python_sdk-1.5.48 → dc_python_sdk-1.5.49}/src/dc_sdk/__init__.py +0 -0
- {dc_python_sdk-1.5.48 → dc_python_sdk-1.5.49}/src/dc_sdk/app.py +0 -0
- {dc_python_sdk-1.5.48 → dc_python_sdk-1.5.49}/src/dc_sdk/errors.py +0 -0
- {dc_python_sdk-1.5.48 → dc_python_sdk-1.5.49}/src/dc_sdk/src/__init__.py +0 -0
- {dc_python_sdk-1.5.48 → dc_python_sdk-1.5.49}/src/dc_sdk/src/ai.py +0 -0
- {dc_python_sdk-1.5.48 → dc_python_sdk-1.5.49}/src/dc_sdk/src/ai_http.py +0 -0
- {dc_python_sdk-1.5.48 → dc_python_sdk-1.5.49}/src/dc_sdk/src/models/__init__.py +0 -0
- {dc_python_sdk-1.5.48 → dc_python_sdk-1.5.49}/src/dc_sdk/src/models/enums.py +0 -0
- {dc_python_sdk-1.5.48 → dc_python_sdk-1.5.49}/src/dc_sdk/src/models/errors.py +0 -0
- {dc_python_sdk-1.5.48 → dc_python_sdk-1.5.49}/src/dc_sdk/src/models/log_templates.py +0 -0
- {dc_python_sdk-1.5.48 → dc_python_sdk-1.5.49}/src/dc_sdk/src/models/pipeline_details.py +0 -0
- {dc_python_sdk-1.5.48 → dc_python_sdk-1.5.49}/src/dc_sdk/src/pipeline.py +0 -0
- {dc_python_sdk-1.5.48 → dc_python_sdk-1.5.49}/src/dc_sdk/src/server.py +0 -0
- {dc_python_sdk-1.5.48 → dc_python_sdk-1.5.49}/src/dc_sdk/src/services/__init__.py +0 -0
- {dc_python_sdk-1.5.48 → dc_python_sdk-1.5.49}/src/dc_sdk/src/services/api.py +0 -0
- {dc_python_sdk-1.5.48 → dc_python_sdk-1.5.49}/src/dc_sdk/src/services/aws.py +0 -0
- {dc_python_sdk-1.5.48 → dc_python_sdk-1.5.49}/src/dc_sdk/src/services/environment.py +0 -0
- {dc_python_sdk-1.5.48 → dc_python_sdk-1.5.49}/src/dc_sdk/src/services/loader.py +0 -0
- {dc_python_sdk-1.5.48 → dc_python_sdk-1.5.49}/src/dc_sdk/src/services/logger.py +0 -0
- {dc_python_sdk-1.5.48 → dc_python_sdk-1.5.49}/src/dc_sdk/src/services/session.py +0 -0
- {dc_python_sdk-1.5.48 → dc_python_sdk-1.5.49}/src/dc_sdk/types.py +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from dc_sdk.errors import Error
|
|
2
2
|
from dc_sdk.src.mapping import Mapping
|
|
3
|
+
from dc_sdk.src.connection_status import STATUS_ERROR
|
|
3
4
|
import traceback
|
|
4
5
|
from importlib.metadata import version
|
|
5
6
|
|
|
@@ -9,7 +10,9 @@ def get_action_name(action: int) -> str:
|
|
|
9
10
|
1: "retrieving fields",
|
|
10
11
|
2: "retrieving 5 row preview",
|
|
11
12
|
3: "testing connection",
|
|
12
|
-
4: "starting the connector"
|
|
13
|
+
4: "starting the connector",
|
|
14
|
+
5: "retrieving metadata",
|
|
15
|
+
6: "retrieving objects",
|
|
13
16
|
}[action]
|
|
14
17
|
|
|
15
18
|
def apply_data_filters(results, data_filters):
|
|
@@ -159,6 +162,9 @@ def handler(event, context):
|
|
|
159
162
|
mapping = None
|
|
160
163
|
action = int(event['action']) if 'action' in event else 4
|
|
161
164
|
get_objects = event.get('get_objects', True)
|
|
165
|
+
skip_authenticate = event.get('skip_authenticate', False)
|
|
166
|
+
force_authenticate = event.get('force_authenticate', False)
|
|
167
|
+
include_metadata = event.get('include_metadata', True)
|
|
162
168
|
credentials_dict = event['credentials'] if 'credentials' in event else None
|
|
163
169
|
object_id = event['object_id'] if 'object_id' in event else None
|
|
164
170
|
field_ids = event['mapping'] if 'mapping' in event else None
|
|
@@ -174,9 +180,14 @@ def handler(event, context):
|
|
|
174
180
|
|
|
175
181
|
if action == 0:
|
|
176
182
|
if get_objects:
|
|
177
|
-
results, message = mapping.connect_get_objects(
|
|
183
|
+
results, message = mapping.connect_get_objects(
|
|
184
|
+
skip_authenticate=skip_authenticate,
|
|
185
|
+
force_authenticate=force_authenticate,
|
|
186
|
+
)
|
|
178
187
|
else:
|
|
179
|
-
results, message = mapping.authenticate(
|
|
188
|
+
results, message = mapping.authenticate(
|
|
189
|
+
force_authenticate=force_authenticate or not skip_authenticate,
|
|
190
|
+
)
|
|
180
191
|
elif action == 1:
|
|
181
192
|
results, message = mapping.get_fields(object_id, options)
|
|
182
193
|
elif action == 2:
|
|
@@ -185,6 +196,17 @@ def handler(event, context):
|
|
|
185
196
|
results = apply_data_filters(results, data_filters)
|
|
186
197
|
elif action == 3:
|
|
187
198
|
results, message = mapping.test_connection()
|
|
199
|
+
elif action == 5:
|
|
200
|
+
results, message = mapping.get_metadata_only(
|
|
201
|
+
skip_authenticate=skip_authenticate,
|
|
202
|
+
force_authenticate=force_authenticate,
|
|
203
|
+
)
|
|
204
|
+
elif action == 6:
|
|
205
|
+
results, message = mapping.get_objects_only(
|
|
206
|
+
skip_authenticate=skip_authenticate,
|
|
207
|
+
force_authenticate=force_authenticate,
|
|
208
|
+
include_metadata=include_metadata,
|
|
209
|
+
)
|
|
188
210
|
else:
|
|
189
211
|
raise Error("Invalid action", "InvalidActionError")
|
|
190
212
|
except Error as e:
|
|
@@ -192,19 +214,28 @@ def handler(event, context):
|
|
|
192
214
|
internal_error = e.internal
|
|
193
215
|
error_trace = traceback.format_exc()
|
|
194
216
|
error = error_trace
|
|
217
|
+
if mapping:
|
|
218
|
+
mapping._set_connection_status(STATUS_ERROR)
|
|
195
219
|
|
|
196
220
|
except Exception as e:
|
|
197
221
|
error_trace = traceback.format_exc()
|
|
198
222
|
error = error_trace
|
|
199
223
|
internal_error = True
|
|
224
|
+
if mapping:
|
|
225
|
+
mapping._set_connection_status(STATUS_ERROR)
|
|
200
226
|
|
|
201
227
|
if error:
|
|
202
228
|
print(error)
|
|
203
229
|
|
|
230
|
+
last_status_dsc = None
|
|
231
|
+
if mapping and mapping.connector.credentials:
|
|
232
|
+
last_status_dsc = mapping.connector.credentials.get("last_status_dsc")
|
|
233
|
+
|
|
204
234
|
return {
|
|
205
235
|
'message': message if not internal_error else f"Something went wrong with {action_name}",
|
|
206
236
|
'results': results,
|
|
207
237
|
'credentials': mapping.connector.credentials if mapping else None,
|
|
238
|
+
'last_status_dsc': last_status_dsc,
|
|
208
239
|
'error': error,
|
|
209
240
|
'internal_error': internal_error
|
|
210
241
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
STATUS_CONNECTED = "Connected"
|
|
2
|
+
STATUS_ERROR = "Error"
|
|
3
|
+
STATUS_UNKNOWN = "Unknown"
|
|
4
|
+
STATUS_NOT_SETUP = "NotSetup"
|
|
5
|
+
STATUS_PENDING = "Pending"
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def normalize_status(status):
|
|
9
|
+
if not status:
|
|
10
|
+
return STATUS_UNKNOWN
|
|
11
|
+
|
|
12
|
+
normalized = str(status).strip()
|
|
13
|
+
lowered = normalized.lower()
|
|
14
|
+
|
|
15
|
+
if lowered in ("connected", "success"):
|
|
16
|
+
return STATUS_CONNECTED
|
|
17
|
+
if lowered in ("error", "failed", "failed to connect"):
|
|
18
|
+
return STATUS_ERROR
|
|
19
|
+
if lowered in ("notsetup", "not_setup", "not setup"):
|
|
20
|
+
return STATUS_NOT_SETUP
|
|
21
|
+
if lowered == "pending":
|
|
22
|
+
return STATUS_PENDING
|
|
23
|
+
if lowered == "unknown":
|
|
24
|
+
return STATUS_UNKNOWN
|
|
25
|
+
|
|
26
|
+
return normalized
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def should_skip_authenticate(status):
|
|
30
|
+
return normalize_status(status) == STATUS_CONNECTED
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def status_from_authenticated(authenticated):
|
|
34
|
+
return STATUS_CONNECTED if authenticated else STATUS_ERROR
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
from dc_sdk import errors
|
|
2
|
+
import logging
|
|
3
|
+
from dc_sdk.src.services.loader import load_connector
|
|
4
|
+
from dc_sdk.src.connection_status import (
|
|
5
|
+
STATUS_CONNECTED,
|
|
6
|
+
STATUS_ERROR,
|
|
7
|
+
should_skip_authenticate,
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
logger = logging.getLogger(__name__)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class Mapping():
|
|
14
|
+
def __init__(self, credentials):
|
|
15
|
+
Connector = load_connector()
|
|
16
|
+
self.connector = Connector(credentials)
|
|
17
|
+
|
|
18
|
+
def _set_connection_status(self, status):
|
|
19
|
+
if self.connector.credentials is None:
|
|
20
|
+
self.connector.credentials = {}
|
|
21
|
+
self.connector.credentials["last_status_dsc"] = status
|
|
22
|
+
|
|
23
|
+
def _initialize_connector_session(self):
|
|
24
|
+
init = getattr(self.connector, "ensure_initialized", None)
|
|
25
|
+
if callable(init):
|
|
26
|
+
init()
|
|
27
|
+
return
|
|
28
|
+
|
|
29
|
+
legacy_init = getattr(self.connector, "_ensure_initialized", None)
|
|
30
|
+
if callable(legacy_init):
|
|
31
|
+
legacy_init()
|
|
32
|
+
return
|
|
33
|
+
|
|
34
|
+
if not self.connector.authenticate():
|
|
35
|
+
raise errors.AuthenticationError(message="Failed to initialize connection session")
|
|
36
|
+
|
|
37
|
+
def _ensure_session(self, force_authenticate=False):
|
|
38
|
+
credentials = self.connector.credentials or {}
|
|
39
|
+
status = credentials.get("last_status_dsc")
|
|
40
|
+
|
|
41
|
+
if not force_authenticate and should_skip_authenticate(status):
|
|
42
|
+
try:
|
|
43
|
+
self._initialize_connector_session()
|
|
44
|
+
return True
|
|
45
|
+
except Exception:
|
|
46
|
+
self._set_connection_status(STATUS_ERROR)
|
|
47
|
+
raise
|
|
48
|
+
|
|
49
|
+
if self.connector.authenticate():
|
|
50
|
+
self._set_connection_status(STATUS_CONNECTED)
|
|
51
|
+
return True
|
|
52
|
+
|
|
53
|
+
self._set_connection_status(STATUS_ERROR)
|
|
54
|
+
raise errors.AuthenticationError(message="Failed to authenticate")
|
|
55
|
+
|
|
56
|
+
def _resolve_session(self, skip_authenticate=False, force_authenticate=False):
|
|
57
|
+
if force_authenticate:
|
|
58
|
+
self._ensure_session(force_authenticate=True)
|
|
59
|
+
return
|
|
60
|
+
|
|
61
|
+
credentials = self.connector.credentials or {}
|
|
62
|
+
status = credentials.get("last_status_dsc")
|
|
63
|
+
|
|
64
|
+
if skip_authenticate and should_skip_authenticate(status):
|
|
65
|
+
self._ensure_session(force_authenticate=False)
|
|
66
|
+
return
|
|
67
|
+
|
|
68
|
+
if skip_authenticate and not should_skip_authenticate(status):
|
|
69
|
+
self._ensure_session(force_authenticate=True)
|
|
70
|
+
return
|
|
71
|
+
|
|
72
|
+
self._ensure_session(force_authenticate=False)
|
|
73
|
+
|
|
74
|
+
def _safe_get_metadata(self):
|
|
75
|
+
try:
|
|
76
|
+
return self.connector.get_metadata()
|
|
77
|
+
except errors.NotImplementedError:
|
|
78
|
+
return None
|
|
79
|
+
except Exception:
|
|
80
|
+
logger.exception("Error getting metadata")
|
|
81
|
+
return None
|
|
82
|
+
|
|
83
|
+
def authenticate(self, force_authenticate=True):
|
|
84
|
+
results = None
|
|
85
|
+
message = None
|
|
86
|
+
|
|
87
|
+
self._ensure_session(force_authenticate=force_authenticate)
|
|
88
|
+
|
|
89
|
+
metadata = self._safe_get_metadata()
|
|
90
|
+
results = {
|
|
91
|
+
"metadata": metadata
|
|
92
|
+
}
|
|
93
|
+
message = "Authenticated successfully"
|
|
94
|
+
|
|
95
|
+
return [results, message]
|
|
96
|
+
|
|
97
|
+
def connect_get_objects(self, skip_authenticate=False, force_authenticate=False):
|
|
98
|
+
results = None
|
|
99
|
+
metadata = None
|
|
100
|
+
objects = None
|
|
101
|
+
message = None
|
|
102
|
+
|
|
103
|
+
self._resolve_session(
|
|
104
|
+
skip_authenticate=skip_authenticate,
|
|
105
|
+
force_authenticate=force_authenticate,
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
objects = self.connector.get_objects()
|
|
109
|
+
metadata = self._safe_get_metadata()
|
|
110
|
+
|
|
111
|
+
results = {
|
|
112
|
+
"metadata": metadata,
|
|
113
|
+
"objects": objects,
|
|
114
|
+
}
|
|
115
|
+
message = "Retrieved objects"
|
|
116
|
+
|
|
117
|
+
return [results, message]
|
|
118
|
+
|
|
119
|
+
def get_metadata_only(self, skip_authenticate=False, force_authenticate=False):
|
|
120
|
+
self._resolve_session(
|
|
121
|
+
skip_authenticate=skip_authenticate,
|
|
122
|
+
force_authenticate=force_authenticate,
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
metadata = self._safe_get_metadata()
|
|
126
|
+
return [{"metadata": metadata}, "Retrieved metadata"]
|
|
127
|
+
|
|
128
|
+
def get_objects_only(self, skip_authenticate=False, force_authenticate=False, include_metadata=True):
|
|
129
|
+
self._resolve_session(
|
|
130
|
+
skip_authenticate=skip_authenticate,
|
|
131
|
+
force_authenticate=force_authenticate,
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
objects = self.connector.get_objects()
|
|
135
|
+
results = {"objects": objects}
|
|
136
|
+
|
|
137
|
+
if include_metadata:
|
|
138
|
+
results["metadata"] = self._safe_get_metadata()
|
|
139
|
+
|
|
140
|
+
return [results, "Retrieved objects"]
|
|
141
|
+
|
|
142
|
+
def test_connection(self):
|
|
143
|
+
results = None
|
|
144
|
+
message = None
|
|
145
|
+
|
|
146
|
+
self._ensure_session(force_authenticate=True)
|
|
147
|
+
message = "Authenticated successfully"
|
|
148
|
+
|
|
149
|
+
return [results, message]
|
|
150
|
+
|
|
151
|
+
def get_fields(self, object_id, options):
|
|
152
|
+
results = None
|
|
153
|
+
message = None
|
|
154
|
+
self._ensure_session(force_authenticate=False)
|
|
155
|
+
results = self.connector.get_fields(object_id, options=options)
|
|
156
|
+
message = "Retrieved fields"
|
|
157
|
+
|
|
158
|
+
return [results, message]
|
|
159
|
+
|
|
160
|
+
def get_five_row_preview(self, object_id, field_ids, options, n_rows=5, filters=None, next_page=None):
|
|
161
|
+
results = None
|
|
162
|
+
message = None
|
|
163
|
+
|
|
164
|
+
self._ensure_session(force_authenticate=False)
|
|
165
|
+
results = self.connector.get_data(
|
|
166
|
+
object_id,
|
|
167
|
+
field_ids=field_ids,
|
|
168
|
+
n_rows=n_rows,
|
|
169
|
+
filters=filters,
|
|
170
|
+
next_page=next_page,
|
|
171
|
+
options=options,
|
|
172
|
+
)
|
|
173
|
+
message = "Retrieved 5 row preview"
|
|
174
|
+
|
|
175
|
+
return [results, message]
|
|
176
|
+
|
|
177
|
+
def get_data(self, object_id, field_ids, n_rows, next_page, options):
|
|
178
|
+
results = None
|
|
179
|
+
message = None
|
|
180
|
+
|
|
181
|
+
self._ensure_session(force_authenticate=False)
|
|
182
|
+
results = self.connector.get_data(
|
|
183
|
+
object_id,
|
|
184
|
+
field_ids=field_ids,
|
|
185
|
+
n_rows=n_rows,
|
|
186
|
+
next_page=next_page,
|
|
187
|
+
options=options,
|
|
188
|
+
)
|
|
189
|
+
message = "Retrieved data"
|
|
190
|
+
|
|
191
|
+
return [results, message]
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
from dc_sdk import errors
|
|
2
|
-
import logging
|
|
3
|
-
from dc_sdk.src.services.loader import load_connector
|
|
4
|
-
|
|
5
|
-
logger = logging.getLogger(__name__)
|
|
6
|
-
class Mapping():
|
|
7
|
-
def __init__(self, credentials):
|
|
8
|
-
Connector = load_connector()
|
|
9
|
-
self.connector = Connector(credentials)
|
|
10
|
-
|
|
11
|
-
def authenticate(self):
|
|
12
|
-
results = None
|
|
13
|
-
metadata = None
|
|
14
|
-
message = None
|
|
15
|
-
|
|
16
|
-
if self.connector.authenticate():
|
|
17
|
-
try:
|
|
18
|
-
metadata = self.connector.get_metadata()
|
|
19
|
-
except errors.NotImplementedError:
|
|
20
|
-
pass
|
|
21
|
-
except:
|
|
22
|
-
logger.exception("Error getting metadata")
|
|
23
|
-
|
|
24
|
-
results = {
|
|
25
|
-
'metadata': metadata
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
message = "Authenticated successfully"
|
|
29
|
-
else:
|
|
30
|
-
raise errors.AuthenticationError(message="Failed to authenticate")
|
|
31
|
-
|
|
32
|
-
return [results, message]
|
|
33
|
-
|
|
34
|
-
def connect_get_objects(self):
|
|
35
|
-
results = None
|
|
36
|
-
metadata = None
|
|
37
|
-
objects = None
|
|
38
|
-
message = None
|
|
39
|
-
|
|
40
|
-
if self.connector.authenticate():
|
|
41
|
-
objects = self.connector.get_objects()
|
|
42
|
-
try:
|
|
43
|
-
metadata = self.connector.get_metadata()
|
|
44
|
-
except errors.NotImplementedError:
|
|
45
|
-
pass
|
|
46
|
-
except Exception as e:
|
|
47
|
-
print("Error getting metadata")
|
|
48
|
-
print(str(e))
|
|
49
|
-
|
|
50
|
-
results = {
|
|
51
|
-
'metadata': metadata,
|
|
52
|
-
'objects': objects,
|
|
53
|
-
}
|
|
54
|
-
message = "Authenticated successfully"
|
|
55
|
-
else:
|
|
56
|
-
# If not authenticated, raise the authentication error.
|
|
57
|
-
raise errors.AuthenticationError(message="Failed to authenticate")
|
|
58
|
-
|
|
59
|
-
return [results, message]
|
|
60
|
-
|
|
61
|
-
def test_connection(self):
|
|
62
|
-
results = None
|
|
63
|
-
message = None
|
|
64
|
-
|
|
65
|
-
if self.connector.authenticate():
|
|
66
|
-
message = "Authenticated successfully"
|
|
67
|
-
else:
|
|
68
|
-
# If not authenticated, raise the authentication error.
|
|
69
|
-
raise errors.AuthenticationError(message="Failed to authenticate")
|
|
70
|
-
|
|
71
|
-
return [results, message]
|
|
72
|
-
|
|
73
|
-
def get_fields(self, object_id, options):
|
|
74
|
-
results = None
|
|
75
|
-
message = None
|
|
76
|
-
if self.connector.authenticate():
|
|
77
|
-
results = self.connector.get_fields(object_id, options=options)
|
|
78
|
-
message = "Retrieved fields"
|
|
79
|
-
else:
|
|
80
|
-
# If not authenticated, raise the authentication error.
|
|
81
|
-
raise errors.AuthenticationError("Failed to authenticate")
|
|
82
|
-
|
|
83
|
-
return [results, message]
|
|
84
|
-
|
|
85
|
-
def get_five_row_preview(self, object_id, field_ids, options, n_rows = 5, filters = None, next_page = None):
|
|
86
|
-
results = None
|
|
87
|
-
message = None
|
|
88
|
-
|
|
89
|
-
if self.connector.authenticate():
|
|
90
|
-
results = self.connector.get_data(object_id, field_ids=field_ids, n_rows=n_rows, filters=filters, next_page=next_page, options=options)
|
|
91
|
-
message = "Retrieved 5 row preview"
|
|
92
|
-
else:
|
|
93
|
-
# If not authenticated, raise the authentication error.
|
|
94
|
-
raise errors.AuthenticationError("Failed to authenticate")
|
|
95
|
-
|
|
96
|
-
return [results, message]
|
|
97
|
-
|
|
98
|
-
def get_data(self, object_id, field_ids, n_rows, next_page, options):
|
|
99
|
-
results = None
|
|
100
|
-
message = None
|
|
101
|
-
|
|
102
|
-
if self.connector.authenticate():
|
|
103
|
-
results = self.connector.get_data(object_id, field_ids=field_ids, n_rows=n_rows, next_page=next_page, options=options)
|
|
104
|
-
message = "Retrieved data"
|
|
105
|
-
else:
|
|
106
|
-
# If not authenticated, raise the authentication error.
|
|
107
|
-
raise errors.AuthenticationError("Failed to authenticate")
|
|
108
|
-
|
|
109
|
-
return [results, message]
|
|
File without changes
|
|
File without changes
|
{dc_python_sdk-1.5.48 → dc_python_sdk-1.5.49}/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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|