dc-python-sdk 1.5.43__tar.gz → 1.5.44__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.
Files changed (35) hide show
  1. {dc_python_sdk-1.5.43/src/dc_python_sdk.egg-info → dc_python_sdk-1.5.44}/PKG-INFO +1 -1
  2. {dc_python_sdk-1.5.43 → dc_python_sdk-1.5.44}/pyproject.toml +6 -2
  3. {dc_python_sdk-1.5.43 → dc_python_sdk-1.5.44}/setup.cfg +1 -1
  4. {dc_python_sdk-1.5.43 → dc_python_sdk-1.5.44/src/dc_python_sdk.egg-info}/PKG-INFO +1 -1
  5. {dc_python_sdk-1.5.43 → dc_python_sdk-1.5.44}/src/dc_sdk/src/pipeline.py +63 -7
  6. {dc_python_sdk-1.5.43 → dc_python_sdk-1.5.44}/LICENSE +0 -0
  7. {dc_python_sdk-1.5.43 → dc_python_sdk-1.5.44}/README.md +0 -0
  8. {dc_python_sdk-1.5.43 → dc_python_sdk-1.5.44}/src/dc_python_sdk.egg-info/SOURCES.txt +0 -0
  9. {dc_python_sdk-1.5.43 → dc_python_sdk-1.5.44}/src/dc_python_sdk.egg-info/dependency_links.txt +0 -0
  10. {dc_python_sdk-1.5.43 → dc_python_sdk-1.5.44}/src/dc_python_sdk.egg-info/entry_points.txt +0 -0
  11. {dc_python_sdk-1.5.43 → dc_python_sdk-1.5.44}/src/dc_python_sdk.egg-info/requires.txt +0 -0
  12. {dc_python_sdk-1.5.43 → dc_python_sdk-1.5.44}/src/dc_python_sdk.egg-info/top_level.txt +0 -0
  13. {dc_python_sdk-1.5.43 → dc_python_sdk-1.5.44}/src/dc_sdk/__init__.py +0 -0
  14. {dc_python_sdk-1.5.43 → dc_python_sdk-1.5.44}/src/dc_sdk/app.py +0 -0
  15. {dc_python_sdk-1.5.43 → dc_python_sdk-1.5.44}/src/dc_sdk/cli.py +0 -0
  16. {dc_python_sdk-1.5.43 → dc_python_sdk-1.5.44}/src/dc_sdk/errors.py +0 -0
  17. {dc_python_sdk-1.5.43 → dc_python_sdk-1.5.44}/src/dc_sdk/handler.py +0 -0
  18. {dc_python_sdk-1.5.43 → dc_python_sdk-1.5.44}/src/dc_sdk/src/__init__.py +0 -0
  19. {dc_python_sdk-1.5.43 → dc_python_sdk-1.5.44}/src/dc_sdk/src/ai.py +0 -0
  20. {dc_python_sdk-1.5.43 → dc_python_sdk-1.5.44}/src/dc_sdk/src/ai_http.py +0 -0
  21. {dc_python_sdk-1.5.43 → dc_python_sdk-1.5.44}/src/dc_sdk/src/mapping.py +0 -0
  22. {dc_python_sdk-1.5.43 → dc_python_sdk-1.5.44}/src/dc_sdk/src/models/__init__.py +0 -0
  23. {dc_python_sdk-1.5.43 → dc_python_sdk-1.5.44}/src/dc_sdk/src/models/enums.py +0 -0
  24. {dc_python_sdk-1.5.43 → dc_python_sdk-1.5.44}/src/dc_sdk/src/models/errors.py +0 -0
  25. {dc_python_sdk-1.5.43 → dc_python_sdk-1.5.44}/src/dc_sdk/src/models/log_templates.py +0 -0
  26. {dc_python_sdk-1.5.43 → dc_python_sdk-1.5.44}/src/dc_sdk/src/models/pipeline_details.py +0 -0
  27. {dc_python_sdk-1.5.43 → dc_python_sdk-1.5.44}/src/dc_sdk/src/server.py +0 -0
  28. {dc_python_sdk-1.5.43 → dc_python_sdk-1.5.44}/src/dc_sdk/src/services/__init__.py +0 -0
  29. {dc_python_sdk-1.5.43 → dc_python_sdk-1.5.44}/src/dc_sdk/src/services/api.py +0 -0
  30. {dc_python_sdk-1.5.43 → dc_python_sdk-1.5.44}/src/dc_sdk/src/services/aws.py +0 -0
  31. {dc_python_sdk-1.5.43 → dc_python_sdk-1.5.44}/src/dc_sdk/src/services/environment.py +0 -0
  32. {dc_python_sdk-1.5.43 → dc_python_sdk-1.5.44}/src/dc_sdk/src/services/loader.py +0 -0
  33. {dc_python_sdk-1.5.43 → dc_python_sdk-1.5.44}/src/dc_sdk/src/services/logger.py +0 -0
  34. {dc_python_sdk-1.5.43 → dc_python_sdk-1.5.44}/src/dc_sdk/src/services/session.py +0 -0
  35. {dc_python_sdk-1.5.43 → dc_python_sdk-1.5.44}/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.43
3
+ Version: 1.5.44
4
4
  Summary: Data Connector Python SDK
5
5
  Home-page: https://github.com/data-connector/dc-python-sdk
6
6
  Author: DataConnector
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "dc-python-sdk"
7
- version = "1.5.43"
7
+ version = "1.5.44"
8
8
  description = "Data Connector Python SDK"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.6"
@@ -45,4 +45,8 @@ ai = [
45
45
  dc-sdk = "dc_sdk.cli:main"
46
46
 
47
47
  [tool.setuptools.packages.find]
48
- where = ["src"]
48
+ where = ["src"]
49
+
50
+ [tool.pytest.ini_options]
51
+ pythonpath = ["src", "tests"]
52
+ testpaths = ["tests"]
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = dc-python-sdk
3
- version = 1.5.43
3
+ version = 1.5.44
4
4
  author = DataConnector
5
5
  author_email = josh@dataconnector.com
6
6
  description = A small example package
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dc-python-sdk
3
- Version: 1.5.43
3
+ Version: 1.5.44
4
4
  Summary: Data Connector Python SDK
5
5
  Home-page: https://github.com/data-connector/dc-python-sdk
6
6
  Author: DataConnector
@@ -1,4 +1,4 @@
1
- import json, io, math, re
1
+ import json, io, math, re, inspect
2
2
  import time
3
3
  from .services.environment import PipelineEnvironment
4
4
  from .services.api import DataConnectorAPI
@@ -163,7 +163,7 @@ class PipelineConductor:
163
163
 
164
164
  if not keys:
165
165
  # Call load_data with empty data when there are no keys
166
- loaded = self.connector.load_data([], self.pipeline_details.destination_object_id, self._get_mapping(), self.pipeline_details.update_method_cd, 0, 1)
166
+ loaded = self._call_connector_load_data([], self.pipeline_details.destination_object_id, self._get_mapping(), self.pipeline_details.update_method_cd, 0, 1)
167
167
  if not loaded:
168
168
  raise errors.LoadDataError("Loading data failed.")
169
169
  else:
@@ -177,7 +177,7 @@ class PipelineConductor:
177
177
 
178
178
  data = json.load(file_object)
179
179
  self.log(self.log_templates.LOAD_DATA_LOADED.format(len(data), self.pipeline_details.destination_object_id))
180
- loaded = self.connector.load_data(data, self.pipeline_details.destination_object_id, self._get_mapping(), self.pipeline_details.update_method_cd, index, len(keys))
180
+ loaded = self._call_connector_load_data(data, self.pipeline_details.destination_object_id, self._get_mapping(), self.pipeline_details.update_method_cd, index, len(keys))
181
181
  if loaded:
182
182
  self.row_count += len(data)
183
183
  if self.mode == "prod":
@@ -190,6 +190,45 @@ class PipelineConductor:
190
190
  raise errors.LoadDataError("Loading data failed.")
191
191
  self.log(self.log_templates.LOAD_DATA_FINISHED.format(self.row_count, self.pipeline_details.destination_object_id))
192
192
 
193
+ def _call_connector_load_data(
194
+ self,
195
+ data,
196
+ object_id,
197
+ mapping,
198
+ update_method,
199
+ batch_number,
200
+ total_batches
201
+ ):
202
+ options = getattr(self.pipeline_details, "options", None) or {}
203
+
204
+ # Put primary key into options for upsert/incremental loads
205
+ primary_key_column_nm = getattr(self.pipeline_details, "primary_key_column_nm", None)
206
+ if primary_key_column_nm:
207
+ options["primary_key_column_nm"] = primary_key_column_nm
208
+
209
+ sig = inspect.signature(self.connector.load_data)
210
+
211
+ if "options" in sig.parameters:
212
+ return self.connector.load_data(
213
+ data,
214
+ object_id,
215
+ mapping,
216
+ update_method,
217
+ batch_number,
218
+ total_batches,
219
+ options=options
220
+ )
221
+
222
+ return self.connector.load_data(
223
+ data,
224
+ object_id,
225
+ mapping,
226
+ update_method,
227
+ batch_number,
228
+ total_batches
229
+ )
230
+
231
+
193
232
  def start_next_connector(self):
194
233
  self.internal_log(self.log_templates.INTERNAL_START_NEXT_CONNECTOR.format(self.pipeline_details.destination_connector_nm, self.pipeline_details.destination_object_id))
195
234
 
@@ -302,13 +341,30 @@ class PipelineConductor:
302
341
  return limit_reached
303
342
 
304
343
  def _get_credentials(self):
305
- encyption_txt = self.pipeline_details.source_encryption_credential_txt if self.task == "SOURCE" else self.pipeline_details.destination_encryption_credential_txt
344
+ is_source = self.task == "SOURCE"
306
345
 
307
- if not encyption_txt:
346
+ encryption_txt = (
347
+ self.pipeline_details.source_encryption_credential_txt
348
+ if is_source
349
+ else self.pipeline_details.destination_encryption_credential_txt
350
+ )
351
+
352
+ if not encryption_txt:
308
353
  return None
309
354
 
310
- # Set Connector Credentials
311
- return self.aws.decrypt_customer_data_object(encyption_txt, self.pipeline_details.customer_metadata_uuid)
355
+ credential_information = (
356
+ self.pipeline_details.source_credential_information
357
+ if is_source
358
+ else self.pipeline_details.destination_credential_information
359
+ ) or {}
360
+
361
+ return self.aws.decrypt_customer_data_object(
362
+ encrypted_data=encryption_txt,
363
+ customer_id=self.pipeline_details.customer_metadata_uuid,
364
+ encrypted_data_key_txt=credential_information.get("encrypted_data_key_txt"),
365
+ encryption_iv_txt=credential_information.get("encryption_iv_txt"),
366
+ encryption_auth_tag_txt=credential_information.get("encryption_auth_tag_txt"),
367
+ )
312
368
 
313
369
  def _get_pipeline_details(self):
314
370
  return self.api.get_pipeline_details(str(self.pipeline_id), self.task, str(self.pipeline_run_history_id), pipeline_mapping_id=self.pipeline_object_id)
File without changes
File without changes