dc-python-sdk 1.5.36__tar.gz → 1.5.38__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.36/src/dc_python_sdk.egg-info → dc_python_sdk-1.5.38}/PKG-INFO +1 -1
- {dc_python_sdk-1.5.36 → dc_python_sdk-1.5.38}/pyproject.toml +1 -1
- {dc_python_sdk-1.5.36 → dc_python_sdk-1.5.38}/setup.cfg +1 -1
- {dc_python_sdk-1.5.36 → dc_python_sdk-1.5.38/src/dc_python_sdk.egg-info}/PKG-INFO +1 -1
- {dc_python_sdk-1.5.36 → dc_python_sdk-1.5.38}/src/dc_sdk/src/models/pipeline_details.py +1 -1
- {dc_python_sdk-1.5.36 → dc_python_sdk-1.5.38}/src/dc_sdk/src/pipeline.py +44 -3
- {dc_python_sdk-1.5.36 → dc_python_sdk-1.5.38}/LICENSE +0 -0
- {dc_python_sdk-1.5.36 → dc_python_sdk-1.5.38}/README.md +0 -0
- {dc_python_sdk-1.5.36 → dc_python_sdk-1.5.38}/src/dc_python_sdk.egg-info/SOURCES.txt +0 -0
- {dc_python_sdk-1.5.36 → dc_python_sdk-1.5.38}/src/dc_python_sdk.egg-info/dependency_links.txt +0 -0
- {dc_python_sdk-1.5.36 → dc_python_sdk-1.5.38}/src/dc_python_sdk.egg-info/entry_points.txt +0 -0
- {dc_python_sdk-1.5.36 → dc_python_sdk-1.5.38}/src/dc_python_sdk.egg-info/requires.txt +0 -0
- {dc_python_sdk-1.5.36 → dc_python_sdk-1.5.38}/src/dc_python_sdk.egg-info/top_level.txt +0 -0
- {dc_python_sdk-1.5.36 → dc_python_sdk-1.5.38}/src/dc_sdk/__init__.py +0 -0
- {dc_python_sdk-1.5.36 → dc_python_sdk-1.5.38}/src/dc_sdk/app.py +0 -0
- {dc_python_sdk-1.5.36 → dc_python_sdk-1.5.38}/src/dc_sdk/cli.py +0 -0
- {dc_python_sdk-1.5.36 → dc_python_sdk-1.5.38}/src/dc_sdk/errors.py +0 -0
- {dc_python_sdk-1.5.36 → dc_python_sdk-1.5.38}/src/dc_sdk/handler.py +0 -0
- {dc_python_sdk-1.5.36 → dc_python_sdk-1.5.38}/src/dc_sdk/src/__init__.py +0 -0
- {dc_python_sdk-1.5.36 → dc_python_sdk-1.5.38}/src/dc_sdk/src/ai.py +0 -0
- {dc_python_sdk-1.5.36 → dc_python_sdk-1.5.38}/src/dc_sdk/src/ai_http.py +0 -0
- {dc_python_sdk-1.5.36 → dc_python_sdk-1.5.38}/src/dc_sdk/src/mapping.py +0 -0
- {dc_python_sdk-1.5.36 → dc_python_sdk-1.5.38}/src/dc_sdk/src/models/__init__.py +0 -0
- {dc_python_sdk-1.5.36 → dc_python_sdk-1.5.38}/src/dc_sdk/src/models/enums.py +0 -0
- {dc_python_sdk-1.5.36 → dc_python_sdk-1.5.38}/src/dc_sdk/src/models/errors.py +0 -0
- {dc_python_sdk-1.5.36 → dc_python_sdk-1.5.38}/src/dc_sdk/src/models/log_templates.py +0 -0
- {dc_python_sdk-1.5.36 → dc_python_sdk-1.5.38}/src/dc_sdk/src/server.py +0 -0
- {dc_python_sdk-1.5.36 → dc_python_sdk-1.5.38}/src/dc_sdk/src/services/__init__.py +0 -0
- {dc_python_sdk-1.5.36 → dc_python_sdk-1.5.38}/src/dc_sdk/src/services/api.py +0 -0
- {dc_python_sdk-1.5.36 → dc_python_sdk-1.5.38}/src/dc_sdk/src/services/aws.py +0 -0
- {dc_python_sdk-1.5.36 → dc_python_sdk-1.5.38}/src/dc_sdk/src/services/environment.py +0 -0
- {dc_python_sdk-1.5.36 → dc_python_sdk-1.5.38}/src/dc_sdk/src/services/loader.py +0 -0
- {dc_python_sdk-1.5.36 → dc_python_sdk-1.5.38}/src/dc_sdk/src/services/logger.py +0 -0
- {dc_python_sdk-1.5.36 → dc_python_sdk-1.5.38}/src/dc_sdk/src/services/session.py +0 -0
- {dc_python_sdk-1.5.36 → dc_python_sdk-1.5.38}/src/dc_sdk/types.py +0 -0
|
@@ -11,7 +11,6 @@ class PipelineDetails:
|
|
|
11
11
|
self.destination_object_id = row_data['destination_object_id']
|
|
12
12
|
self.pipeline_mapping_json = row_data['pipeline_mapping_json']
|
|
13
13
|
self.update_method_cd = row_data['update_method_cd']
|
|
14
|
-
self.primary_key_column_nm = row_data['primary_key_column_nm']
|
|
15
14
|
self.source_connector_id = row_data['source_connector_id']
|
|
16
15
|
self.source_connector_nm = row_data['source_connector_nm']
|
|
17
16
|
self.destination_connector_id = row_data['destination_connector_id']
|
|
@@ -33,6 +32,7 @@ class PipelineDetails:
|
|
|
33
32
|
self.destination_ecs_task_version_nbr = row_data['destination_ecs_task_version_nbr']
|
|
34
33
|
self.options = json.loads(row_data['pipeline_object_options_json']) if 'pipeline_object_options_json' in row_data and row_data['pipeline_object_options_json'] else dict()
|
|
35
34
|
self.max_allowed_retrieval = row_data.get('max_allowed_retrieval')
|
|
35
|
+
self.primary_key_column_nm = row_data.get('primary_key_column_nm')
|
|
36
36
|
|
|
37
37
|
def increment_stage(self):
|
|
38
38
|
self.stage += 1
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import json, io, math
|
|
1
|
+
import json, io, math, re
|
|
2
2
|
import time
|
|
3
3
|
from .services.environment import PipelineEnvironment
|
|
4
4
|
from .services.api import DataConnectorAPI
|
|
@@ -213,7 +213,8 @@ class PipelineConductor:
|
|
|
213
213
|
if not fields:
|
|
214
214
|
raise errors.NoFieldsFoundError(self.pipeline_details.source_object_id)
|
|
215
215
|
|
|
216
|
-
|
|
216
|
+
|
|
217
|
+
mapping = self._build_auto_field_mapping(fields)
|
|
217
218
|
|
|
218
219
|
self.pipeline_details.pipeline_mapping_json = json.dumps(mapping)
|
|
219
220
|
|
|
@@ -371,4 +372,44 @@ class PipelineConductor:
|
|
|
371
372
|
def _get_log_messages(self):
|
|
372
373
|
# TODO: Make logs more dynamic
|
|
373
374
|
# logs = self.api.get("log/templates")
|
|
374
|
-
return LogTemplates(task=self.task)
|
|
375
|
+
return LogTemplates(task=self.task)
|
|
376
|
+
|
|
377
|
+
def _sanitize_pipeline_column_name(self, label, field_id):
|
|
378
|
+
"""Destination-safe name: letters, digits, underscores only; no leading digit."""
|
|
379
|
+
if label is None:
|
|
380
|
+
text = ""
|
|
381
|
+
else:
|
|
382
|
+
text = str(label).strip()
|
|
383
|
+
if not text:
|
|
384
|
+
text = str(field_id) if field_id is not None else ""
|
|
385
|
+
text = str(text).strip()
|
|
386
|
+
safe = re.sub(r"[^A-Za-z0-9]+", "_", text).strip("_")
|
|
387
|
+
if not safe:
|
|
388
|
+
fid = str(field_id) if field_id is not None else "field"
|
|
389
|
+
safe = re.sub(r"[^A-Za-z0-9]+", "_", fid).strip("_") or "field"
|
|
390
|
+
if safe[0].isdigit():
|
|
391
|
+
safe = "c_" + safe
|
|
392
|
+
return safe[:120]
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
def _build_auto_field_mapping(self, fields):
|
|
396
|
+
"""
|
|
397
|
+
Build pipeline mapping: mapped = source field_id (row keys from get_data),
|
|
398
|
+
column = safe destination identifier derived from field_name / field_label.
|
|
399
|
+
"""
|
|
400
|
+
seen = {}
|
|
401
|
+
mapping = []
|
|
402
|
+
for field in fields:
|
|
403
|
+
fid = field["field_id"]
|
|
404
|
+
label = field.get("field_name") or field.get("field_label") or fid
|
|
405
|
+
base = self._sanitize_pipeline_column_name(label, fid)
|
|
406
|
+
name = base
|
|
407
|
+
i = 2
|
|
408
|
+
while name in seen:
|
|
409
|
+
suffix = f"_{i}"
|
|
410
|
+
trim = max(1, 120 - len(suffix))
|
|
411
|
+
name = base[:trim] + suffix
|
|
412
|
+
i += 1
|
|
413
|
+
seen[name] = True
|
|
414
|
+
mapping.append({"column": name, "mapped": fid})
|
|
415
|
+
return mapping
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dc_python_sdk-1.5.36 → dc_python_sdk-1.5.38}/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
|
|
File without changes
|