omnata-plugin-runtime 0.10.10a261__py3-none-any.whl → 0.10.12__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.
- omnata_plugin_runtime/json_schema.py +38 -27
- {omnata_plugin_runtime-0.10.10a261.dist-info → omnata_plugin_runtime-0.10.12.dist-info}/METADATA +1 -1
- {omnata_plugin_runtime-0.10.10a261.dist-info → omnata_plugin_runtime-0.10.12.dist-info}/RECORD +5 -5
- {omnata_plugin_runtime-0.10.10a261.dist-info → omnata_plugin_runtime-0.10.12.dist-info}/LICENSE +0 -0
- {omnata_plugin_runtime-0.10.10a261.dist-info → omnata_plugin_runtime-0.10.12.dist-info}/WHEEL +0 -0
@@ -463,6 +463,12 @@ class SnowflakeViewParts(BaseModel):
|
|
463
463
|
There will be a final SELECT statement that selects all columns from the main stream, and then adds any columns obtained via joins.
|
464
464
|
In the final select statement, the join columns will be aliased with their transformed names.
|
465
465
|
"""
|
466
|
+
# Deduplicate the joined parts
|
467
|
+
joined_parts_deduped:List[SnowflakeViewPart] = []
|
468
|
+
for part in self.joined_parts:
|
469
|
+
if part.stream_name!=self.main_part.stream_name and part.stream_name not in [p.stream_name for p in joined_parts_deduped]:
|
470
|
+
joined_parts_deduped.append(part)
|
471
|
+
|
466
472
|
# first, we need to collapse all referenced columns into a single map
|
467
473
|
all_referenced_columns:Dict[str,List[str]] = {}
|
468
474
|
for part in [self.main_part] + self.joined_parts:
|
@@ -566,35 +572,40 @@ class SnowflakeViewParts(BaseModel):
|
|
566
572
|
|
567
573
|
return cls(main_part=main_stream_view_part, joined_parts=joined_parts)
|
568
574
|
|
569
|
-
def prune(view_part:SnowflakeViewPart,joined_parts:List[SnowflakeViewPart]) -> bool:
|
575
|
+
def prune(view_part: SnowflakeViewPart, joined_parts: List[SnowflakeViewPart]) -> bool:
|
570
576
|
"""
|
571
|
-
|
572
|
-
|
577
|
+
Iteratively prunes columns from the main view part that reference fields
|
578
|
+
that are not available in the joined parts.
|
573
579
|
"""
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
if
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
580
|
+
stack = [(view_part, joined_parts)]
|
581
|
+
columns_removed = False
|
582
|
+
|
583
|
+
while stack:
|
584
|
+
current_part, current_joined_parts = stack.pop()
|
585
|
+
for column in current_part.columns[:]: # Iterate over a copy to allow safe removal
|
586
|
+
if column.referenced_columns:
|
587
|
+
for referenced_stream_name, referenced_fields in column.referenced_columns.items():
|
588
|
+
if referenced_stream_name == current_part.stream_name:
|
589
|
+
part = current_part
|
590
|
+
else:
|
591
|
+
part = next((p for p in current_joined_parts if p.stream_name == referenced_stream_name), None)
|
592
|
+
if part is None:
|
593
|
+
logger.warning(f"Column {column.name} in stream {current_part.stream_name} references stream {referenced_stream_name}, but it was not provided")
|
594
|
+
current_part.columns.remove(column)
|
595
|
+
columns_removed = True
|
596
|
+
break
|
597
|
+
|
598
|
+
columns_missing_from_join = part.columns_missing(referenced_fields)
|
599
|
+
if columns_missing_from_join:
|
600
|
+
logger.warning(f"Column {column.name} in stream {current_part.stream_name} references fields {columns_missing_from_join} in stream {referenced_stream_name}, but they were not provided")
|
601
|
+
current_part.columns.remove(column)
|
602
|
+
columns_removed = True
|
603
|
+
break
|
604
|
+
else:
|
605
|
+
if part != current_part:
|
606
|
+
stack.append((part, current_joined_parts))
|
607
|
+
|
608
|
+
return columns_removed
|
598
609
|
|
599
610
|
class JsonSchemaTopLevel(BaseModel):
|
600
611
|
"""
|
{omnata_plugin_runtime-0.10.10a261.dist-info → omnata_plugin_runtime-0.10.12.dist-info}/RECORD
RENAMED
@@ -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=0rfIGv8rCu8OwL7m-VOXIBjd05iyaBWRdt2h9o6scwo,46754
|
4
4
|
omnata_plugin_runtime/forms.py,sha256=9YHJ_T17lT-rwyDaUg_0yj_YMPda4DRCw_wrvf8hE0E,19964
|
5
|
-
omnata_plugin_runtime/json_schema.py,sha256
|
5
|
+
omnata_plugin_runtime/json_schema.py,sha256=-CKMWBphgSdAuJvczGfkhXBbynFtLrNdx7E7O70LCXk,36267
|
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.
|
11
|
-
omnata_plugin_runtime-0.10.
|
12
|
-
omnata_plugin_runtime-0.10.
|
13
|
-
omnata_plugin_runtime-0.10.
|
10
|
+
omnata_plugin_runtime-0.10.12.dist-info/LICENSE,sha256=rGaMQG3R3F5-JGDp_-rlMKpDIkg5n0SI4kctTk8eZSI,56
|
11
|
+
omnata_plugin_runtime-0.10.12.dist-info/METADATA,sha256=z2ADvDIfknfl-jih91kpaWnqqy6l0vh-bS_3X3yqgm8,2208
|
12
|
+
omnata_plugin_runtime-0.10.12.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
13
|
+
omnata_plugin_runtime-0.10.12.dist-info/RECORD,,
|
{omnata_plugin_runtime-0.10.10a261.dist-info → omnata_plugin_runtime-0.10.12.dist-info}/LICENSE
RENAMED
File without changes
|
{omnata_plugin_runtime-0.10.10a261.dist-info → omnata_plugin_runtime-0.10.12.dist-info}/WHEEL
RENAMED
File without changes
|