omnata-plugin-runtime 0.10.30a290__py3-none-any.whl → 0.10.30a294__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.
@@ -191,11 +191,17 @@ class SnowflakeViewColumn(BaseModel):
191
191
  self.referenced_columns
192
192
  )
193
193
 
194
- def definition(self,original_name:bool = False) -> str:
194
+ def definition(self,original_name:bool = False, remove_stream_prefix:Optional[str] = None) -> str:
195
195
  """
196
196
  Returns the column definition for a normalized view.
197
197
  If original_name is True, the original name will be used instead of the transformed name.
198
198
  """
199
+ if remove_stream_prefix is not None and self.referenced_columns is not None:
200
+ if remove_stream_prefix in self.referenced_columns:
201
+ for referenced_column in self.referenced_columns[remove_stream_prefix]:
202
+ replace_source = f'"{remove_stream_prefix}"."{referenced_column}"'
203
+ replace_target = f'"{referenced_column}"'
204
+ self.expression = self.expression.replace(replace_source, replace_target)
199
205
  if original_name:
200
206
  return f'{self.expression} as "{self.original_name}"'
201
207
  return f'{self.expression} as "{self.name}"'
@@ -454,9 +460,14 @@ class SnowflakeViewPart(BaseModel):
454
460
  """
455
461
  Returns the CTE text for this view part.
456
462
  """
463
+ if include_only_columns is None:
464
+ return f""" "{self.stream_name}" as (
465
+ select {', '.join([c.definition(original_name=original_name,remove_stream_prefix=self.stream_name) for c in self.direct_columns()])}
466
+ from {self.raw_table_location.get_fully_qualified_name()}
467
+ ) """
457
468
  return f""" "{self.stream_name}" as (
458
- select {', '.join([c.definition(original_name=original_name) for c in self.direct_columns()
459
- if include_only_columns is None or c.original_name in include_only_columns])}
469
+ select {', '.join([c.definition(original_name=original_name,remove_stream_prefix=self.stream_name) for c in self.columns
470
+ if c.original_name in include_only_columns])}
460
471
  from {self.raw_table_location.get_fully_qualified_name()}
461
472
  ) """
462
473
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: omnata-plugin-runtime
3
- Version: 0.10.30a290
3
+ Version: 0.10.30a294
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=SffokJfgvy6V3kUsoEjXcK3GdNgHo6U3mgBEs0qBv4I,46972
4
4
  omnata_plugin_runtime/forms.py,sha256=Lrbr3otsFDrvHWJw7v-slsW4PvEHJ6BG1Yl8oaJfiDo,20529
5
- omnata_plugin_runtime/json_schema.py,sha256=fLu44kK3smkMDMBMI-CS6O9G_vGunpp6FrvH6g_Be-o,48388
5
+ omnata_plugin_runtime/json_schema.py,sha256=wT8M1iVlfl_KoGYxYAB4rdYuXH25S49xPQO8odqZ0No,49204
6
6
  omnata_plugin_runtime/logging.py,sha256=WBuZt8lF9E5oFWM4KYQbE8dDJ_HctJ1pN3BHwU6rcd0,4461
7
7
  omnata_plugin_runtime/omnata_plugin.py,sha256=RnUEO_iPFqJEaixLDFfrzCC-HmEAtEIT_lgfgNyjBUs,134532
8
8
  omnata_plugin_runtime/plugin_entrypoints.py,sha256=SlpI3VF3EdTGFCr9wDD0kV4v6B6bHfNDFdC3slU2y8Y,32241
9
9
  omnata_plugin_runtime/rate_limiting.py,sha256=qpr5esU4Ks8hMzuMpSR3gLFdor2ZUXYWCjmsQH_K6lQ,25882
10
- omnata_plugin_runtime-0.10.30a290.dist-info/LICENSE,sha256=rGaMQG3R3F5-JGDp_-rlMKpDIkg5n0SI4kctTk8eZSI,56
11
- omnata_plugin_runtime-0.10.30a290.dist-info/METADATA,sha256=ZMmzVCa2enWnuTHmVmtL8YxXmRjcsSPkCaB8SyXfDOA,2212
12
- omnata_plugin_runtime-0.10.30a290.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
13
- omnata_plugin_runtime-0.10.30a290.dist-info/RECORD,,
10
+ omnata_plugin_runtime-0.10.30a294.dist-info/LICENSE,sha256=rGaMQG3R3F5-JGDp_-rlMKpDIkg5n0SI4kctTk8eZSI,56
11
+ omnata_plugin_runtime-0.10.30a294.dist-info/METADATA,sha256=PDKSfj93YwO4q3CvFVQnhJg55BevP_79pqq_wVt9PZs,2212
12
+ omnata_plugin_runtime-0.10.30a294.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
13
+ omnata_plugin_runtime-0.10.30a294.dist-info/RECORD,,