cloe-nessy 1.0.5__py3-none-any.whl → 1.0.7__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.
@@ -1,3 +1,5 @@
1
+ import contextlib
2
+
1
3
  from pydantic import BaseModel, Field
2
4
  from pyspark.sql import DataFrame
3
5
  from pyspark.sql import functions as F
@@ -231,7 +233,9 @@ class DeltaCDFLoader(DeltaLoader):
231
233
  df = self.table_reader.load(self.table_identifier)
232
234
 
233
235
  # Cache the DataFrame since it will be used for both counting and returning
234
- df.cache()
236
+ # Note: .cache() is not supported on serverless compute, so we suppress errors
237
+ with contextlib.suppress(Exception):
238
+ df.cache()
235
239
  row_count = df.count()
236
240
 
237
241
  self._create_metadata_entry(
@@ -280,7 +284,9 @@ class DeltaCDFLoader(DeltaLoader):
280
284
  df = df.filter("_change_type <> 'update_preimage'")
281
285
 
282
286
  # Cache the DataFrame as it will be used multiple times
283
- df.cache()
287
+ # Note: .cache() is not supported on serverless compute, so we suppress errors
288
+ with contextlib.suppress(Exception):
289
+ df.cache()
284
290
 
285
291
  # Optimize timestamp extraction by combining operations
286
292
  start_commit_timestamp = None
@@ -338,7 +344,9 @@ class DeltaCDFLoader(DeltaLoader):
338
344
  result_df = df.drop("_commit_version", "_commit_timestamp")
339
345
 
340
346
  # Unpersist the cached DataFrame to free memory
341
- df.unpersist()
347
+ # Note: unpersist may fail if cache wasn't successful on serverless
348
+ with contextlib.suppress(Exception):
349
+ df.unpersist()
342
350
 
343
351
  return result_df
344
352
 
@@ -71,7 +71,12 @@ class CatalogReader(BaseReader):
71
71
  df = self._spark.read.table(table_identifier, **options)
72
72
  return df
73
73
  except AnalysisException as err:
74
- raise ValueError(f"Table not found: {table_identifier}") from err
74
+ # Only convert to "Table not found" if it's actually a table not found error
75
+ error_message = str(err)
76
+ if "not found" in error_message.lower() or "does not exist" in error_message.lower():
77
+ raise ValueError(f"Table not found: {table_identifier}") from err
78
+ # Re-raise other AnalysisException errors with original message
79
+ raise
75
80
  except Exception as err:
76
81
  raise ReadOperationFailedError(
77
82
  f"An error occurred while reading the table '{table_identifier}': {err}"
@@ -111,7 +116,12 @@ class CatalogReader(BaseReader):
111
116
  df = self._spark.readStream.table(table_identifier, **options)
112
117
  return df
113
118
  except AnalysisException as err:
114
- raise ValueError(f"Table not found or not streamable: {table_identifier}") from err
119
+ # Only convert to "Table not found" if it's actually a table not found error
120
+ error_message = str(err)
121
+ if "not found" in error_message.lower() or "does not exist" in error_message.lower():
122
+ raise ValueError(f"Table not found or not streamable: {table_identifier}") from err
123
+ # Re-raise other AnalysisException errors with original message
124
+ raise
115
125
  except Exception as err:
116
126
  raise ReadOperationFailedError(
117
127
  f"An error occurred while reading the stream from table '{table_identifier}': {err}"
@@ -211,8 +211,8 @@ class PipelineParsingService:
211
211
 
212
212
  @staticmethod
213
213
  def _fix_yaml_str_with_templates(yaml_str: str) -> str:
214
- """Fixes unquoted {{env:...}} templates before yaml.safe_load."""
215
- unquoted_template = re.compile(r"(:)\s*(\{\{env:[^}]+\}\})(?=\s*$|\s+#)", re.MULTILINE)
214
+ """Fixes unquoted {{env:...}} templates (with optional prefix/suffix) before yaml.safe_load."""
215
+ unquoted_template = re.compile(r"(:)\s*([^\s#]*\{\{env:[^}]+\}\}[^\s#]*)", re.MULTILINE)
216
216
 
217
217
  def replacer(match):
218
218
  colon, template = match.groups()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cloe-nessy
3
- Version: 1.0.5
3
+ Version: 1.0.7
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>
@@ -25,11 +25,11 @@ cloe_nessy/integration/delta_loader/delta_loader.py,sha256=WOl44Udvo6hZ5PVFgabpe
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
28
- cloe_nessy/integration/delta_loader/strategies/delta_cdf_loader.py,sha256=sDilieWLmaw8JsjQcNRL4znmLZVvkJAzy0exjuTHUKk,16688
28
+ cloe_nessy/integration/delta_loader/strategies/delta_cdf_loader.py,sha256=kbBr0w5yqIwyohWjDosRBzEPKFyebPGxB96uB5f0FyY,17104
29
29
  cloe_nessy/integration/delta_loader/strategies/delta_timestamp_loader.py,sha256=QV2smynYVfi3W7goKotPrGMPkahvIFEWT32LO56eWEI,6191
30
30
  cloe_nessy/integration/reader/__init__.py,sha256=NWQx-v6aKE8YOHhsxfeaZnMVq4KLKyRWXzUduf5aVsk,265
31
31
  cloe_nessy/integration/reader/api_reader.py,sha256=H6alDoCuGsxuhxpuN-JbL9-eMDchE9ZMq9P0hnz7t1I,20007
32
- cloe_nessy/integration/reader/catalog_reader.py,sha256=DlnykmFjV_v8SCBh3qaCvf24QM-6TdMFVHx5Mqv7Nvs,4850
32
+ cloe_nessy/integration/reader/catalog_reader.py,sha256=hOXZMmsvDnTrICHU1DMwkeDYrJX8ZVLXMwg5n2zOnCU,5494
33
33
  cloe_nessy/integration/reader/excel_reader.py,sha256=dq_XbuQ_BcQwFuxld-12vzBA2F7hVhNkmMJvgAM-_R8,7937
34
34
  cloe_nessy/integration/reader/exceptions.py,sha256=_A9jFpe_RIDZCGY76qzjic9bsshxns6yXPSl141dq1c,203
35
35
  cloe_nessy/integration/reader/file_reader.py,sha256=1pf3kVk8UMEf0JPQiwhMLIszl55aLYaEDwS2Fp_9TT8,8261
@@ -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=eeC4RbGBILGN6zkbUyjH-qGgEMtOWV4Kv_VxrHbHMY0,9021
74
+ cloe_nessy/pipeline/pipeline_parsing_service.py,sha256=gpaxt5v-1i9JGz5kvu3esf0nwfhNHZ_eawl7Ei45zos,9052
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.5.dist-info/METADATA,sha256=NnYdhZTmeAouyXDAUTj4ELCOKUzNtDBkd_Rfvlf7ygM,3289
117
- cloe_nessy-1.0.5.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
118
- cloe_nessy-1.0.5.dist-info/RECORD,,
116
+ cloe_nessy-1.0.7.dist-info/METADATA,sha256=BZ59Gk-ZRf8EeXKFKH7Uz1bQAzWS_pjNtJRSjlwKHCc,3289
117
+ cloe_nessy-1.0.7.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
118
+ cloe_nessy-1.0.7.dist-info/RECORD,,