cloe-nessy 1.0.9__py3-none-any.whl → 1.0.10__py3-none-any.whl

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.
@@ -39,7 +39,10 @@ class DeltaLoader(ABC, LoggerMixin):
39
39
  or f"{self.table_identifier.split('.')[0]}.{self.table_identifier.split('.')[1]}.metadata_delta_load"
40
40
  )
41
41
  table_manager = TableManager()
42
- table_manager.create_table(table=DeltaLoaderMetadataTable(identifier=self.metadata_table_identifier))
42
+ table_manager.create_table(
43
+ table=DeltaLoaderMetadataTable(identifier=self.metadata_table_identifier),
44
+ ignore_if_exists=True,
45
+ )
43
46
 
44
47
  @abstractmethod
45
48
  def read_data(
@@ -64,9 +64,17 @@ class PipelineParsingService:
64
64
  if not yaml_str:
65
65
  raise ValueError("YAML content is empty.")
66
66
 
67
- secrets_repl_yaml_str = PipelineParsingService._replace_secret_refs(yaml_str)
68
- fixed_yaml_str = PipelineParsingService._fix_yaml_str_with_templates(secrets_repl_yaml_str)
69
- config = yaml.safe_load(fixed_yaml_str)
67
+ try:
68
+ secrets_repl_yaml_str = PipelineParsingService._replace_secret_refs(yaml_str)
69
+ fixed_yaml_str = PipelineParsingService._fix_yaml_str_with_templates(secrets_repl_yaml_str)
70
+ config = yaml.safe_load(fixed_yaml_str)
71
+ except yaml.YAMLError as e:
72
+ console_logger.error("Failed to parse YAML. Check for syntax errors or unquoted template variables.")
73
+ console_logger.error("Original error: %s", str(e))
74
+ raise ValueError(
75
+ f"YAML parsing failed. Ensure all template variables like {{env:VAR}} are "
76
+ f"properly formatted and YAML syntax is correct. Error: {e}"
77
+ ) from e
70
78
  pipeline_config = PipelineConfig.metadata_to_instance(config)
71
79
  steps = PipelineParsingService._get_steps(pipeline_config.steps, pipeline_config.env)
72
80
  pipeline = Pipeline(name=pipeline_config.name, steps=steps) # type: ignore
@@ -211,11 +219,24 @@ class PipelineParsingService:
211
219
 
212
220
  @staticmethod
213
221
  def _fix_yaml_str_with_templates(yaml_str: str) -> str:
214
- """Fixes unquoted {{env:...}} templates (with optional prefix/suffix) before yaml.safe_load. Skips values already quoted with ' or "."""
215
- unquoted_template = re.compile(r"(:)\s*(?!['\"])([^\s#]*\{\{env:[^}]+\}\}[^\s#]*)", re.MULTILINE)
222
+ """Fixes unquoted template patterns before yaml.safe_load.
223
+
224
+ Handles:
225
+ - {{env:...}} - environment variables
226
+ - ((step:...)) - step references
227
+
228
+ Skips values already quoted with ' or ".
229
+ """
230
+ # Match any unquoted template pattern (env or step)
231
+ # This regex matches: colon + optional whitespace + unquoted value containing template
232
+ unquoted_template = re.compile(
233
+ r"(:)\s*(?!['\"])([^\s#]*(?:\{\{env:[^}]+\}\}|\(\(step:[^)]+\)\))[^\s#]*)", re.MULTILINE
234
+ )
216
235
 
217
236
  def replacer(match):
218
237
  colon, template = match.groups()
219
- return f'{colon} "{template}"'
238
+ # Escape any double quotes in the template value
239
+ escaped_template = template.replace('"', '\\"')
240
+ return f'{colon} "{escaped_template}"'
220
241
 
221
242
  return unquoted_template.sub(replacer, yaml_str)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cloe-nessy
3
- Version: 1.0.9
3
+ Version: 1.0.10
4
4
  Summary: Your friendly datalake monster.
5
5
  Project-URL: homepage, https://initions.com/
6
6
  Author-email: initions <ICSMC_EXT_PYPIORG@accenture.com>
@@ -21,7 +21,7 @@ cloe_nessy/file_utilities/strategies/utils_strategy.py,sha256=w4nrS6IcPPN7UBFBws
21
21
  cloe_nessy/integration/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
22
  cloe_nessy/integration/delta_loader/__init__.py,sha256=ZdBDde1uPtTCL_KAhilVmtVmmGvH5dHb05QsOozkteE,438
23
23
  cloe_nessy/integration/delta_loader/delta_load_options.py,sha256=W3P3gwtkBW3pWbUEOK6agvJfj7QivXhEr_s0dwxhJxQ,1369
24
- cloe_nessy/integration/delta_loader/delta_loader.py,sha256=RiHCsCc5_70KVYT2tiZFbuJyb6xPKNtD1ExEtwLO-1c,6946
24
+ cloe_nessy/integration/delta_loader/delta_loader.py,sha256=2uSsfFpL3R_Qovx-bOYnhWh3x48r3Otp9xFv-gyoZy8,7004
25
25
  cloe_nessy/integration/delta_loader/delta_loader_factory.py,sha256=vB1cL6-Nc3SkLH1xtazMbMF1MnNYq8-g3GHZzRE3QmE,2251
26
26
  cloe_nessy/integration/delta_loader/delta_loader_metadata_table.py,sha256=G_EWUY76ZlbsPZB9LCGlOLVezk7DK6peYXEgt7-sTQE,1683
27
27
  cloe_nessy/integration/delta_loader/strategies/__init__.py,sha256=1o5fRWenL5KnUg1hf7kmTuTpG9pbMxchiQTub52Qvwo,255
@@ -71,7 +71,7 @@ cloe_nessy/pipeline/pipeline_action.py,sha256=S7IVFdmG12fRBzHuE_DiWn7qlMtApz6Ilo
71
71
  cloe_nessy/pipeline/pipeline_builder.py,sha256=_BBl43two0pherkTXZ-Yrpt6XcLW8Q-Z98qxbFIsMao,7929
72
72
  cloe_nessy/pipeline/pipeline_config.py,sha256=oVQ-IH4etTGZVVEnE-5iDPLYOtWpvDlltWFv1nevnqQ,3229
73
73
  cloe_nessy/pipeline/pipeline_context.py,sha256=eCOcjyE16rGRom3L85Gy_BbncfQD6i1x31yrWqZws-4,1881
74
- cloe_nessy/pipeline/pipeline_parsing_service.py,sha256=sMnUDAL0PBLbKupC_TWxBT1X9-Y9I5dPSqAxAkWyweA,9102
74
+ cloe_nessy/pipeline/pipeline_parsing_service.py,sha256=qVDckjEqv4qYD0jUABs4BSbgYC3w-A_SpqBmqr7qCxk,9978
75
75
  cloe_nessy/pipeline/pipeline_plotting_service.py,sha256=OjdYDQW19yXjdcqs7bDMlyWmv0cQz7Qn4I2cakBgN2E,13139
76
76
  cloe_nessy/pipeline/pipeline_step.py,sha256=oTnlvRpB0fbOBQXbPe1URstA5fv-97igCHt_41fKCAk,2082
77
77
  cloe_nessy/pipeline/actions/__init__.py,sha256=FfAnSIl-0T6pnaWhClkDqV8nfTdvLvZZJdwycsZMLPw,2990
@@ -113,6 +113,6 @@ cloe_nessy/settings/settings.py,sha256=I4n129lrujriW-d8q4as2Kb4_kI932ModfZ5Ow_Up
113
113
  cloe_nessy/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
114
114
  cloe_nessy/utils/column_names.py,sha256=dCNtm61mc5aLkY2oE4rlfN3VLCrpot6fOESjAZmCmhA,361
115
115
  cloe_nessy/utils/file_and_directory_handler.py,sha256=r2EVt9xG81p6ScaJCwETC5an6pMT6WseB0jMOR-JlpU,602
116
- cloe_nessy-1.0.9.dist-info/METADATA,sha256=imtWtMJfxQToZnS30gWkb_DW3XIahzqkbVjYk3cajVA,3289
117
- cloe_nessy-1.0.9.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
118
- cloe_nessy-1.0.9.dist-info/RECORD,,
116
+ cloe_nessy-1.0.10.dist-info/METADATA,sha256=NaIr91k5JZzPptDRnVq28odbhx2bhVxDuixXGbL3QIc,3290
117
+ cloe_nessy-1.0.10.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
118
+ cloe_nessy-1.0.10.dist-info/RECORD,,