omnata-plugin-runtime 0.10.7a247__tar.gz → 0.10.7a248__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.
- {omnata_plugin_runtime-0.10.7a247 → omnata_plugin_runtime-0.10.7a248}/PKG-INFO +1 -1
- {omnata_plugin_runtime-0.10.7a247 → omnata_plugin_runtime-0.10.7a248}/pyproject.toml +1 -1
- {omnata_plugin_runtime-0.10.7a247 → omnata_plugin_runtime-0.10.7a248}/src/omnata_plugin_runtime/json_schema.py +18 -9
- {omnata_plugin_runtime-0.10.7a247 → omnata_plugin_runtime-0.10.7a248}/LICENSE +0 -0
- {omnata_plugin_runtime-0.10.7a247 → omnata_plugin_runtime-0.10.7a248}/README.md +0 -0
- {omnata_plugin_runtime-0.10.7a247 → omnata_plugin_runtime-0.10.7a248}/src/omnata_plugin_runtime/__init__.py +0 -0
- {omnata_plugin_runtime-0.10.7a247 → omnata_plugin_runtime-0.10.7a248}/src/omnata_plugin_runtime/api.py +0 -0
- {omnata_plugin_runtime-0.10.7a247 → omnata_plugin_runtime-0.10.7a248}/src/omnata_plugin_runtime/configuration.py +0 -0
- {omnata_plugin_runtime-0.10.7a247 → omnata_plugin_runtime-0.10.7a248}/src/omnata_plugin_runtime/forms.py +0 -0
- {omnata_plugin_runtime-0.10.7a247 → omnata_plugin_runtime-0.10.7a248}/src/omnata_plugin_runtime/logging.py +0 -0
- {omnata_plugin_runtime-0.10.7a247 → omnata_plugin_runtime-0.10.7a248}/src/omnata_plugin_runtime/omnata_plugin.py +0 -0
- {omnata_plugin_runtime-0.10.7a247 → omnata_plugin_runtime-0.10.7a248}/src/omnata_plugin_runtime/plugin_entrypoints.py +0 -0
- {omnata_plugin_runtime-0.10.7a247 → omnata_plugin_runtime-0.10.7a248}/src/omnata_plugin_runtime/rate_limiting.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "omnata-plugin-runtime"
|
3
|
-
version = "0.10.7-
|
3
|
+
version = "0.10.7-a248"
|
4
4
|
description = "Classes and common runtime components for building and running Omnata Plugins"
|
5
5
|
authors = ["James Weakley <james.weakley@omnata.com>"]
|
6
6
|
readme = "README.md"
|
@@ -251,6 +251,13 @@ class SnowflakeViewColumn(BaseModel):
|
|
251
251
|
|
252
252
|
# Collect columns to be moved
|
253
253
|
columns_to_move:List[Self] = []
|
254
|
+
# Collect Omnata System columns and keep them at the front
|
255
|
+
omnata_system_columns = []
|
256
|
+
for column in join_columns[:]:
|
257
|
+
if column.original_name.startswith("OMNATA_"):
|
258
|
+
join_columns.remove(column)
|
259
|
+
omnata_system_columns.append(column)
|
260
|
+
|
254
261
|
for column in join_columns:
|
255
262
|
for other_column in join_columns:
|
256
263
|
if f'"{column.original_name}"' in other_column.expression:
|
@@ -261,7 +268,7 @@ class SnowflakeViewColumn(BaseModel):
|
|
261
268
|
for column in columns_to_move:
|
262
269
|
join_columns.remove(column)
|
263
270
|
join_columns.insert(0, column)
|
264
|
-
return join_columns
|
271
|
+
return omnata_system_columns + join_columns
|
265
272
|
|
266
273
|
|
267
274
|
class SnowflakeViewJoin(BaseModel):
|
@@ -369,13 +376,13 @@ class SnowflakeViewPart(BaseModel):
|
|
369
376
|
"""
|
370
377
|
Returns the columns that are not sourced from joins.
|
371
378
|
"""
|
372
|
-
return
|
379
|
+
return [c for c in self.columns if not c.is_join_column]
|
373
380
|
|
374
381
|
def join_columns(self) -> List[SnowflakeViewColumn]:
|
375
382
|
"""
|
376
383
|
Returns the columns that are sourced from joins.
|
377
384
|
"""
|
378
|
-
return
|
385
|
+
return [c for c in self.columns if c.is_join_column]
|
379
386
|
|
380
387
|
def comment_clause(self) -> str:
|
381
388
|
"""
|
@@ -431,12 +438,16 @@ class SnowflakeViewParts(BaseModel):
|
|
431
438
|
final_cte = f""" OMNATA_FINAL_CTE as (
|
432
439
|
select {', '.join(
|
433
440
|
[
|
434
|
-
f'"{c.original_name}"' for c in self.main_part.direct_columns()
|
441
|
+
f'"{self.main_part.stream_name}"."{c.original_name}"' for c in self.main_part.direct_columns()
|
435
442
|
]+[
|
436
443
|
c.definition(original_name=True) for c in self.main_part.join_columns()
|
437
444
|
])}
|
438
|
-
from "{self.main_part.stream_name}"
|
439
|
-
)
|
445
|
+
from "{self.main_part.stream_name}" """
|
446
|
+
if len(self.main_part.joins) > 0:
|
447
|
+
join_clauses = [join.definition() for join in self.main_part.joins]
|
448
|
+
final_cte += "\n" + ("\n".join(join_clauses))
|
449
|
+
final_cte += ")"
|
450
|
+
|
440
451
|
ctes.append(final_cte)
|
441
452
|
all_ctes = "\n,".join(ctes)
|
442
453
|
main_columns:List[SnowflakeViewColumn] = SnowflakeViewColumn.order_by_reference(self.main_part.direct_columns() +
|
@@ -447,9 +458,7 @@ class SnowflakeViewParts(BaseModel):
|
|
447
458
|
view_body = f"""with {all_ctes}
|
448
459
|
select {', '.join(column_clauses)}
|
449
460
|
from OMNATA_FINAL_CTE """
|
450
|
-
|
451
|
-
join_clauses = [join.definition() for join in self.main_part.joins]
|
452
|
-
view_body += "\n" + ("\n".join(join_clauses))
|
461
|
+
|
453
462
|
return view_body
|
454
463
|
|
455
464
|
@classmethod
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|