omnata-plugin-runtime 0.10.6a243__py3-none-any.whl → 0.10.6a244__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.
@@ -257,13 +257,6 @@ class SnowflakeViewColumn(BaseModel):
257
257
  if column not in columns_to_move:
258
258
  columns_to_move.append(column)
259
259
 
260
- # do another pass, this time replacing the original name with the transformed name
261
- for column in join_columns:
262
- for other_column in join_columns:
263
- if f'"{column.original_name}"' in other_column.expression:
264
- if column.original_name != column.name:
265
- other_column.expression = other_column.expression.replace(f'"{column.original_name}"',f'"{column.name}"')
266
-
267
260
  # Move collected columns to the front
268
261
  for column in columns_to_move:
269
262
  join_columns.remove(column)
@@ -433,11 +426,17 @@ class SnowflakeViewParts(BaseModel):
433
426
  In the final select statement, the join columns will be aliased with their transformed names.
434
427
  """
435
428
  ctes = [self.main_part.cte_text(original_name=True)] + [part.cte_text(original_name=True) for part in self.joined_parts]
429
+ # we need a final CTE which selects the main part's direct columns and joined columns, with their original names
430
+ # then the final select statement will just be aliasing to the transformed names
431
+ final_cte = f""" OMNATA_FINAL_CTE as (
432
+ select {', '.join([c.definition(original_name=True) for c in self.main_part.direct_columns() + self.main_part.join_columns()])}
433
+ from "{self.main_part.stream_name}"
434
+ ) """
435
+ ctes.append(final_cte)
436
436
  all_ctes = "\n,".join(ctes)
437
- main_columns = SnowflakeViewColumn.order_by_reference(self.main_part.direct_columns() +
437
+ main_columns:List[SnowflakeViewColumn] = SnowflakeViewColumn.order_by_reference(self.main_part.direct_columns() +
438
438
  self.main_part.join_columns())
439
- column_clauses = [c.definition() if c.is_join_column
440
- else f"\"{self.main_part.stream_name}\"."+c.original_to_transformed()
439
+ column_clauses = [f"\"OMNATA_FINAL_CTE\"."+c.original_to_transformed()
441
440
  for c in main_columns]
442
441
 
443
442
  view_body = f"""with {all_ctes}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: omnata-plugin-runtime
3
- Version: 0.10.6a243
3
+ Version: 0.10.6a244
4
4
  Summary: Classes and common runtime components for building and running Omnata Plugins
5
5
  Author: James Weakley
6
6
  Author-email: james.weakley@omnata.com
@@ -2,12 +2,12 @@ omnata_plugin_runtime/__init__.py,sha256=MS9d1whnfT_B3-ThqZ7l63QeC_8OEKTuaYV5wTw
2
2
  omnata_plugin_runtime/api.py,sha256=baGraSMiD4Yvi3ZWrEv_TKh8Ktd1U8riBdOpe9j0Puw,8202
3
3
  omnata_plugin_runtime/configuration.py,sha256=fpSyBr3Dr7GNdil88915VtMwRy5pexkGCRBk7BLFpPs,46527
4
4
  omnata_plugin_runtime/forms.py,sha256=9YHJ_T17lT-rwyDaUg_0yj_YMPda4DRCw_wrvf8hE0E,19964
5
- omnata_plugin_runtime/json_schema.py,sha256=IgOsQHahs5sNdBF5kyWdVttwFMSCJTt8wWt0NRhNMb8,30281
5
+ omnata_plugin_runtime/json_schema.py,sha256=H2b9V8j6BbcsoXKbcvMdo3mcmi7yuhisQDDvQPN9u-k,30279
6
6
  omnata_plugin_runtime/logging.py,sha256=WBuZt8lF9E5oFWM4KYQbE8dDJ_HctJ1pN3BHwU6rcd0,4461
7
7
  omnata_plugin_runtime/omnata_plugin.py,sha256=M0b6f9lKKEoEI0zf-ZwZcIPKPQTmHTIMhvcrBc94Mhg,133278
8
8
  omnata_plugin_runtime/plugin_entrypoints.py,sha256=iqGl8_nEEnPGKg3Aem4YLSQ6d5xS3ju5gq8MJbx6sCA,31968
9
9
  omnata_plugin_runtime/rate_limiting.py,sha256=qpr5esU4Ks8hMzuMpSR3gLFdor2ZUXYWCjmsQH_K6lQ,25882
10
- omnata_plugin_runtime-0.10.6a243.dist-info/LICENSE,sha256=rGaMQG3R3F5-JGDp_-rlMKpDIkg5n0SI4kctTk8eZSI,56
11
- omnata_plugin_runtime-0.10.6a243.dist-info/METADATA,sha256=LQXQSk2R81PNx0UQu3UOSCHWwu6P4NIl-CmOU80nA4c,2211
12
- omnata_plugin_runtime-0.10.6a243.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
13
- omnata_plugin_runtime-0.10.6a243.dist-info/RECORD,,
10
+ omnata_plugin_runtime-0.10.6a244.dist-info/LICENSE,sha256=rGaMQG3R3F5-JGDp_-rlMKpDIkg5n0SI4kctTk8eZSI,56
11
+ omnata_plugin_runtime-0.10.6a244.dist-info/METADATA,sha256=gLvf2vfyTaAStETaBzywqDRauNF0DifGJ0YUVWrO1Uk,2211
12
+ omnata_plugin_runtime-0.10.6a244.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
13
+ omnata_plugin_runtime-0.10.6a244.dist-info/RECORD,,