omnata-plugin-runtime 0.10.25__py3-none-any.whl → 0.10.26a281__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 +17 -5
- {omnata_plugin_runtime-0.10.25.dist-info → omnata_plugin_runtime-0.10.26a281.dist-info}/METADATA +1 -1
- {omnata_plugin_runtime-0.10.25.dist-info → omnata_plugin_runtime-0.10.26a281.dist-info}/RECORD +5 -5
- {omnata_plugin_runtime-0.10.25.dist-info → omnata_plugin_runtime-0.10.26a281.dist-info}/LICENSE +0 -0
- {omnata_plugin_runtime-0.10.25.dist-info → omnata_plugin_runtime-0.10.26a281.dist-info}/WHEEL +0 -0
@@ -3,7 +3,7 @@ Models used to represent JSON schemas and Snowflake view definitions.
|
|
3
3
|
This was originally internal to the Sync Engine, but was moved to the
|
4
4
|
plugin runtime so that it could be used for testing column expressions (formulas, etc).
|
5
5
|
"""
|
6
|
-
from typing import Any, Dict, Optional, Literal, List, Union
|
6
|
+
from typing import Any, Dict, Optional, Literal, List, Union, Tuple
|
7
7
|
from typing_extensions import Self
|
8
8
|
from pydantic import BaseModel, Field, model_validator, computed_field
|
9
9
|
from jinja2 import Environment
|
@@ -574,8 +574,8 @@ class SnowflakeViewParts(BaseModel):
|
|
574
574
|
# We need to check both by stream name and by join stream alias
|
575
575
|
|
576
576
|
# Build mappings for stream names and aliases
|
577
|
-
stream_to_aliases = {} # stream_name -> set of aliases
|
578
|
-
alias_to_stream = {} # alias -> stream_name
|
577
|
+
stream_to_aliases:Dict[str,set] = {} # stream_name -> set of aliases
|
578
|
+
alias_to_stream:Dict[str,str] = {} # alias -> stream_name
|
579
579
|
|
580
580
|
# Initialize with the main stream
|
581
581
|
stream_to_aliases[main_stream_view_part.stream_name] = {main_stream_view_part.stream_name}
|
@@ -586,7 +586,7 @@ class SnowflakeViewParts(BaseModel):
|
|
586
586
|
logger.debug(f"Processing joins for stream: {part.stream_name}")
|
587
587
|
# Make sure the part's stream name is in the mappings
|
588
588
|
if part.stream_name not in stream_to_aliases:
|
589
|
-
stream_to_aliases[part.stream_name] =
|
589
|
+
stream_to_aliases[part.stream_name] = [part.stream_name]
|
590
590
|
alias_to_stream[part.stream_name] = part.stream_name
|
591
591
|
|
592
592
|
for join in part.joins:
|
@@ -610,7 +610,7 @@ class SnowflakeViewParts(BaseModel):
|
|
610
610
|
break
|
611
611
|
|
612
612
|
# Build a graph of references between streams and their aliases
|
613
|
-
circular_refs = {} # (source, target) -> [(column_name, ref_fields)]
|
613
|
+
circular_refs:Dict[Tuple[str,str],List[Tuple[str,List[str]]]] = {} # (source, target) -> [(column_name, ref_fields)]
|
614
614
|
|
615
615
|
# First, add references based on column dependencies
|
616
616
|
for part in [main_stream_view_part] + joined_parts:
|
@@ -775,7 +775,19 @@ def prune(view_part: SnowflakeViewPart, joined_parts: List[SnowflakeViewPart]) -
|
|
775
775
|
|
776
776
|
# Process joined parts
|
777
777
|
for joined_part in joined_parts:
|
778
|
+
# We have to avoid pruning columns that are referenced by joins to this stream.
|
779
|
+
# first, we determine all aliases for this stream (multiple join paths back to the same stream are allowed)
|
780
|
+
aliases_for_stream = [j.join_stream_alias for j in view_part.joins if j.join_stream_name == joined_part.stream_name]
|
781
|
+
# now find all joins using this stream as the join stream
|
782
|
+
columns_used_in_joins = [
|
783
|
+
j.left_column for j in view_part.joins if j.left_alias in aliases_for_stream
|
784
|
+
]
|
778
785
|
for column in joined_part.columns[:]: # Use a copy to allow safe removal
|
786
|
+
# First check if the column is a join column
|
787
|
+
if column.original_name in columns_used_in_joins:
|
788
|
+
# If it's a join column, we need to keep it
|
789
|
+
continue
|
790
|
+
|
779
791
|
if not should_keep_column(column, joined_part):
|
780
792
|
joined_part.columns.remove(column)
|
781
793
|
columns_removed = True
|
{omnata_plugin_runtime-0.10.25.dist-info → omnata_plugin_runtime-0.10.26a281.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=ud3O9R03BbUjGUJDVpGbnADqKw5oLVy65EQN1g6gmKg,46811
|
4
4
|
omnata_plugin_runtime/forms.py,sha256=Lrbr3otsFDrvHWJw7v-slsW4PvEHJ6BG1Yl8oaJfiDo,20529
|
5
|
-
omnata_plugin_runtime/json_schema.py,sha256=
|
5
|
+
omnata_plugin_runtime/json_schema.py,sha256=FlzHyiwGUi1YYpYYG5PFETQhnREWoCEBFHImJi4IG0U,46718
|
6
6
|
omnata_plugin_runtime/logging.py,sha256=WBuZt8lF9E5oFWM4KYQbE8dDJ_HctJ1pN3BHwU6rcd0,4461
|
7
7
|
omnata_plugin_runtime/omnata_plugin.py,sha256=vD6FKJIFzTRYbj1Q51LSE-Kar4GPTq9SJcBU5jCYtiQ,134074
|
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.
|
11
|
-
omnata_plugin_runtime-0.10.
|
12
|
-
omnata_plugin_runtime-0.10.
|
13
|
-
omnata_plugin_runtime-0.10.
|
10
|
+
omnata_plugin_runtime-0.10.26a281.dist-info/LICENSE,sha256=rGaMQG3R3F5-JGDp_-rlMKpDIkg5n0SI4kctTk8eZSI,56
|
11
|
+
omnata_plugin_runtime-0.10.26a281.dist-info/METADATA,sha256=YV1dNopiivThdthsqWTES60aN12KCGnXC57oGmIaxUc,2212
|
12
|
+
omnata_plugin_runtime-0.10.26a281.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
13
|
+
omnata_plugin_runtime-0.10.26a281.dist-info/RECORD,,
|
{omnata_plugin_runtime-0.10.25.dist-info → omnata_plugin_runtime-0.10.26a281.dist-info}/LICENSE
RENAMED
File without changes
|
{omnata_plugin_runtime-0.10.25.dist-info → omnata_plugin_runtime-0.10.26a281.dist-info}/WHEEL
RENAMED
File without changes
|