dc-python-sdk 1.5.45__tar.gz → 1.5.46__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.45/src/dc_python_sdk.egg-info → dc_python_sdk-1.5.46}/PKG-INFO +1 -1
- {dc_python_sdk-1.5.45 → dc_python_sdk-1.5.46}/pyproject.toml +1 -1
- {dc_python_sdk-1.5.45 → dc_python_sdk-1.5.46}/setup.cfg +1 -1
- {dc_python_sdk-1.5.45 → dc_python_sdk-1.5.46/src/dc_python_sdk.egg-info}/PKG-INFO +1 -1
- {dc_python_sdk-1.5.45 → dc_python_sdk-1.5.46}/src/dc_sdk/src/models/pipeline_details.py +1 -0
- {dc_python_sdk-1.5.45 → dc_python_sdk-1.5.46}/src/dc_sdk/src/pipeline.py +5 -47
- {dc_python_sdk-1.5.45 → dc_python_sdk-1.5.46}/src/dc_sdk/src/services/api.py +12 -0
- {dc_python_sdk-1.5.45 → dc_python_sdk-1.5.46}/LICENSE +0 -0
- {dc_python_sdk-1.5.45 → dc_python_sdk-1.5.46}/README.md +0 -0
- {dc_python_sdk-1.5.45 → dc_python_sdk-1.5.46}/src/dc_python_sdk.egg-info/SOURCES.txt +0 -0
- {dc_python_sdk-1.5.45 → dc_python_sdk-1.5.46}/src/dc_python_sdk.egg-info/dependency_links.txt +0 -0
- {dc_python_sdk-1.5.45 → dc_python_sdk-1.5.46}/src/dc_python_sdk.egg-info/entry_points.txt +0 -0
- {dc_python_sdk-1.5.45 → dc_python_sdk-1.5.46}/src/dc_python_sdk.egg-info/requires.txt +0 -0
- {dc_python_sdk-1.5.45 → dc_python_sdk-1.5.46}/src/dc_python_sdk.egg-info/top_level.txt +0 -0
- {dc_python_sdk-1.5.45 → dc_python_sdk-1.5.46}/src/dc_sdk/__init__.py +0 -0
- {dc_python_sdk-1.5.45 → dc_python_sdk-1.5.46}/src/dc_sdk/app.py +0 -0
- {dc_python_sdk-1.5.45 → dc_python_sdk-1.5.46}/src/dc_sdk/cli.py +0 -0
- {dc_python_sdk-1.5.45 → dc_python_sdk-1.5.46}/src/dc_sdk/errors.py +0 -0
- {dc_python_sdk-1.5.45 → dc_python_sdk-1.5.46}/src/dc_sdk/handler.py +0 -0
- {dc_python_sdk-1.5.45 → dc_python_sdk-1.5.46}/src/dc_sdk/src/__init__.py +0 -0
- {dc_python_sdk-1.5.45 → dc_python_sdk-1.5.46}/src/dc_sdk/src/ai.py +0 -0
- {dc_python_sdk-1.5.45 → dc_python_sdk-1.5.46}/src/dc_sdk/src/ai_http.py +0 -0
- {dc_python_sdk-1.5.45 → dc_python_sdk-1.5.46}/src/dc_sdk/src/mapping.py +0 -0
- {dc_python_sdk-1.5.45 → dc_python_sdk-1.5.46}/src/dc_sdk/src/models/__init__.py +0 -0
- {dc_python_sdk-1.5.45 → dc_python_sdk-1.5.46}/src/dc_sdk/src/models/enums.py +0 -0
- {dc_python_sdk-1.5.45 → dc_python_sdk-1.5.46}/src/dc_sdk/src/models/errors.py +0 -0
- {dc_python_sdk-1.5.45 → dc_python_sdk-1.5.46}/src/dc_sdk/src/models/log_templates.py +0 -0
- {dc_python_sdk-1.5.45 → dc_python_sdk-1.5.46}/src/dc_sdk/src/server.py +0 -0
- {dc_python_sdk-1.5.45 → dc_python_sdk-1.5.46}/src/dc_sdk/src/services/__init__.py +0 -0
- {dc_python_sdk-1.5.45 → dc_python_sdk-1.5.46}/src/dc_sdk/src/services/aws.py +0 -0
- {dc_python_sdk-1.5.45 → dc_python_sdk-1.5.46}/src/dc_sdk/src/services/environment.py +0 -0
- {dc_python_sdk-1.5.45 → dc_python_sdk-1.5.46}/src/dc_sdk/src/services/loader.py +0 -0
- {dc_python_sdk-1.5.45 → dc_python_sdk-1.5.46}/src/dc_sdk/src/services/logger.py +0 -0
- {dc_python_sdk-1.5.45 → dc_python_sdk-1.5.46}/src/dc_sdk/src/services/session.py +0 -0
- {dc_python_sdk-1.5.45 → dc_python_sdk-1.5.46}/src/dc_sdk/types.py +0 -0
|
@@ -37,6 +37,7 @@ class PipelineDetails:
|
|
|
37
37
|
self.primary_key_column_nm = row_data.get('primary_key_column_nm')
|
|
38
38
|
self.updated_date_column_nm = row_data.get('updated_date_column_nm')
|
|
39
39
|
self.sync_cursor_dsc = row_data.get('sync_cursor_dsc')
|
|
40
|
+
self.pending_sync_cursor_dsc = row_data.get('pending_sync_cursor_dsc')
|
|
40
41
|
|
|
41
42
|
def increment_stage(self):
|
|
42
43
|
self.stage += 1
|
|
@@ -155,7 +155,7 @@ class PipelineConductor:
|
|
|
155
155
|
self._update_extracted_sync_cursor(results.get("metadata"))
|
|
156
156
|
|
|
157
157
|
if self._should_track_sync_cursor():
|
|
158
|
-
self.
|
|
158
|
+
self._save_pending_sync_cursor()
|
|
159
159
|
|
|
160
160
|
self.log(self.log_templates.GET_DATA_FINISH.format(self.row_count, self.pipeline_details.source_object_id))
|
|
161
161
|
|
|
@@ -256,61 +256,19 @@ class PipelineConductor:
|
|
|
256
256
|
if self.extracted_sync_cursor is None or sync_cursor > self.extracted_sync_cursor:
|
|
257
257
|
self.extracted_sync_cursor = sync_cursor
|
|
258
258
|
|
|
259
|
-
def
|
|
260
|
-
return f"transfers/e{self.pipeline_run_history_id}-sync_cursor.json"
|
|
261
|
-
|
|
262
|
-
def _upload_extracted_sync_cursor(self):
|
|
259
|
+
def _save_pending_sync_cursor(self):
|
|
263
260
|
if self.extracted_sync_cursor is None:
|
|
264
261
|
return
|
|
265
262
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
key_name = self._get_sync_cursor_key_name()
|
|
269
|
-
|
|
270
|
-
if PipelineEnvironment.platform == "aws":
|
|
271
|
-
self.aws.upload_object(key_name, json_buffer=json_buffer)
|
|
272
|
-
elif PipelineEnvironment.platform == "azure":
|
|
273
|
-
key_name = f"{PipelineEnvironment.app_env}/{key_name}"
|
|
274
|
-
self.azure.upload_object(key_name, json_buffer=json_buffer)
|
|
275
|
-
|
|
276
|
-
self.internal_log(f"Uploaded sync cursor sidecar to {key_name}")
|
|
277
|
-
|
|
278
|
-
def _load_extracted_sync_cursor(self):
|
|
279
|
-
key_name = self._get_sync_cursor_key_name()
|
|
280
|
-
|
|
281
|
-
try:
|
|
282
|
-
if PipelineEnvironment.platform == "aws":
|
|
283
|
-
file_object = self.aws.download_object(key_name)
|
|
284
|
-
elif PipelineEnvironment.platform == "azure":
|
|
285
|
-
file_object = self.azure.download_object(
|
|
286
|
-
f"{PipelineEnvironment.app_env}/{key_name}"
|
|
287
|
-
)
|
|
288
|
-
else:
|
|
289
|
-
return None
|
|
290
|
-
|
|
291
|
-
payload = json.load(file_object)
|
|
292
|
-
return payload.get("sync_cursor")
|
|
293
|
-
except Exception as e:
|
|
294
|
-
self.internal_log(f"No sync cursor sidecar found: {e}")
|
|
295
|
-
return None
|
|
263
|
+
if self.mode == "prod":
|
|
264
|
+
self.api.save_pending_sync_cursor(self.pipeline_id, self.extracted_sync_cursor)
|
|
296
265
|
|
|
297
266
|
def _persist_sync_cursor_after_load(self):
|
|
298
267
|
if self.task != "DESTINATION":
|
|
299
268
|
return
|
|
300
269
|
|
|
301
|
-
sync_cursor = self._load_extracted_sync_cursor()
|
|
302
|
-
if sync_cursor is None:
|
|
303
|
-
return
|
|
304
|
-
|
|
305
270
|
if self.mode == "prod":
|
|
306
|
-
self.api.
|
|
307
|
-
|
|
308
|
-
if PipelineEnvironment.platform == "aws":
|
|
309
|
-
self.aws.delete_object(self._get_sync_cursor_key_name())
|
|
310
|
-
elif PipelineEnvironment.platform == "azure":
|
|
311
|
-
self.azure.delete_object(
|
|
312
|
-
f"{PipelineEnvironment.app_env}/{self._get_sync_cursor_key_name()}"
|
|
313
|
-
)
|
|
271
|
+
self.api.commit_sync_cursor(self.pipeline_id)
|
|
314
272
|
|
|
315
273
|
def _call_connector_load_data(
|
|
316
274
|
self,
|
|
@@ -113,6 +113,18 @@ class DataConnectorAPI:
|
|
|
113
113
|
|
|
114
114
|
self.post(f"{pipeline_id}/mapping", body)
|
|
115
115
|
|
|
116
|
+
def save_pending_sync_cursor(self, pipeline_id, pending_sync_cursor):
|
|
117
|
+
self.put(
|
|
118
|
+
f"{pipeline_id}/pending-sync-cursor",
|
|
119
|
+
{"pending_sync_cursor_dsc": pending_sync_cursor},
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
def commit_sync_cursor(self, pipeline_id):
|
|
123
|
+
self.put(
|
|
124
|
+
f"{pipeline_id}/sync-cursor",
|
|
125
|
+
{"commit": True},
|
|
126
|
+
)
|
|
127
|
+
|
|
116
128
|
def save_sync_cursor(self, pipeline_id, sync_cursor):
|
|
117
129
|
self.put(
|
|
118
130
|
f"{pipeline_id}/sync-cursor",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dc_python_sdk-1.5.45 → dc_python_sdk-1.5.46}/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
|